Permalink
Browse files

Fix crash on lsof on python3

  • Loading branch information...
paradoxxxzero committed May 15, 2017
1 parent 0625e05 commit 269dd2b618248efddbb7b9a78a36ccf32b804a24
Showing with 7 additions and 6 deletions.
  1. +1 −1 .gitignore
  2. +3 −3 Makefile
  3. +2 −1 Makefile.config
  4. +1 −1 butterfly/utils.py
View
@@ -9,4 +9,4 @@ sass/scss
*.egg-info/
build/
.cache/
.env/
.env*
View
@@ -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)
View
@@ -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
View
@@ -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

0 comments on commit 269dd2b

Please sign in to comment.