aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Kriechbaumer <Kriechi@users.noreply.github.com>2016-07-12 19:31:42 +0200
committerGitHub <noreply@github.com>2016-07-12 19:31:42 +0200
commit9267b2b5013f76ad8183719543590f9df124bdb8 (patch)
tree7d6a0b48e9c7a3dace41e23c507e7055f5ca29a3
parent4fd71d7bfdb3d0568262be807eed1268441df9e9 (diff)
parent6a9407d7cc4ac5555180a2ee331ff95eef131902 (diff)
downloadmitmproxy-9267b2b5013f76ad8183719543590f9df124bdb8.tar.gz
mitmproxy-9267b2b5013f76ad8183719543590f9df124bdb8.tar.bz2
mitmproxy-9267b2b5013f76ad8183719543590f9df124bdb8.zip
Merge pull request #1345 from strohu/patch-2
Make sudo pfctl error check Python 3 compatible
-rw-r--r--mitmproxy/platform/osx.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/mitmproxy/platform/osx.py b/mitmproxy/platform/osx.py
index b5dce793..6a555f32 100644
--- a/mitmproxy/platform/osx.py
+++ b/mitmproxy/platform/osx.py
@@ -23,12 +23,12 @@ class Resolver(object):
try:
stxt = subprocess.check_output(self.STATECMD, stderr=subprocess.STDOUT)
except subprocess.CalledProcessError as e:
- if "sudo: a password is required" in e.output:
+ if "sudo: a password is required" in e.output.decode(errors="replace"):
insufficient_priv = True
else:
raise RuntimeError("Error getting pfctl state: " + repr(e))
else:
- insufficient_priv = "sudo: a password is required" in stxt
+ insufficient_priv = "sudo: a password is required" in stxt.decode(errors="replace")
if insufficient_priv:
raise RuntimeError(