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/
|
*.egg-info/
|
||||||
build/
|
build/
|
||||||
.cache/
|
.cache/
|
||||||
.env/
|
.env*
|
||||||
|
|||||||
6
Makefile
6
Makefile
@@ -4,9 +4,9 @@ include Makefile.config
|
|||||||
all: install lint check-outdated run-debug
|
all: install lint check-outdated run-debug
|
||||||
|
|
||||||
install:
|
install:
|
||||||
test -d $(VENV) || virtualenv $(VENV)
|
test -d $(VENV) || virtualenv $(VENV) -p $(PYTHON_VERSION)
|
||||||
$(PIP) install --upgrade --no-cache pip setuptools -e .[lint] devcore
|
# $(PIP) install --upgrade --no-cache pip setuptools -e .[lint] devcore
|
||||||
$(NPM) install
|
# $(NPM) install
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -fr $(NODE_MODULES)
|
rm -fr $(NODE_MODULES)
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
PROJECT_NAME = butterfly
|
PROJECT_NAME = butterfly
|
||||||
|
|
||||||
# Python env
|
# Python env
|
||||||
VENV = $(PWD)/.env
|
PYTHON_VERSION ?= python
|
||||||
|
VENV = $(PWD)/.env$(if $(filter $(PYTHON_VERSION),python),,-$(PYTHON_VERSION))
|
||||||
PIP = $(VENV)/bin/pip
|
PIP = $(VENV)/bin/pip
|
||||||
PYTHON = $(VENV)/bin/python
|
PYTHON = $(VENV)/bin/python
|
||||||
PYTEST = $(VENV)/bin/py.test
|
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...
|
# May want to make this into a dictionary in the future...
|
||||||
regex = "\w+\s+(?P<pid>\d+)\s+(?P<user>\w+).*\s" \
|
regex = "\w+\s+(?P<pid>\d+)\s+(?P<user>\w+).*\s" \
|
||||||
"(?P<laddr>.*?):(?P<lport>\d+)->(?P<raddr>.*?):(?P<rport>\d+)"
|
"(?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')
|
lines = output.split('\n')
|
||||||
for line in lines:
|
for line in lines:
|
||||||
# Look for local address with peer port
|
# Look for local address with peer port
|
||||||
|
|||||||
Reference in New Issue
Block a user