mirror of
https://github.com/paradoxxxzero/butterfly.git
synced 2026-05-26 07:08:08 +00:00
Fix crash on lsof on python3
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -9,4 +9,4 @@ sass/scss
|
||||
*.egg-info/
|
||||
build/
|
||||
.cache/
|
||||
.env/
|
||||
.env*
|
||||
|
||||
6
Makefile
6
Makefile
@@ -4,9 +4,9 @@ include Makefile.config
|
||||
all: install lint check-outdated run-debug
|
||||
|
||||
install:
|
||||
test -d $(VENV) || virtualenv $(VENV)
|
||||
$(PIP) install --upgrade --no-cache pip setuptools -e .[lint] devcore
|
||||
$(NPM) install
|
||||
test -d $(VENV) || virtualenv $(VENV) -p $(PYTHON_VERSION)
|
||||
# $(PIP) install --upgrade --no-cache pip setuptools -e .[lint] devcore
|
||||
# $(NPM) install
|
||||
|
||||
clean:
|
||||
rm -fr $(NODE_MODULES)
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
PROJECT_NAME = butterfly
|
||||
|
||||
# Python env
|
||||
VENV = $(PWD)/.env
|
||||
PYTHON_VERSION ?= python
|
||||
VENV = $(PWD)/.env$(if $(filter $(PYTHON_VERSION),python),,-$(PYTHON_VERSION))
|
||||
PIP = $(VENV)/bin/pip
|
||||
PYTHON = $(VENV)/bin/python
|
||||
PYTEST = $(VENV)/bin/py.test
|
||||
|
||||
@@ -168,7 +168,7 @@ def get_lsof_socket_line(addr, port):
|
||||
# May want to make this into a dictionary in the future...
|
||||
regex = "\w+\s+(?P<pid>\d+)\s+(?P<user>\w+).*\s" \
|
||||
"(?P<laddr>.*?):(?P<lport>\d+)->(?P<raddr>.*?):(?P<rport>\d+)"
|
||||
output = subprocess.check_output(['lsof', '-Pni'])
|
||||
output = subprocess.check_output(['lsof', '-Pni']).decode('utf-8')
|
||||
lines = output.split('\n')
|
||||
for line in lines:
|
||||
# Look for local address with peer port
|
||||
|
||||
Reference in New Issue
Block a user