aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Haupert <vincent.haupert@gmail.com>2016-07-30 12:42:33 +0200
committerVincent Haupert <vincent.haupert@gmail.com>2016-07-30 12:42:33 +0200
commit73b7da1a0360f50e660e1983ec02dd5225bde3a3 (patch)
treec3af808aa6db3f85ed3b36c812a604a4252c9398
parent63f64cd66086f302f53456f29f60b1e28c8ee178 (diff)
downloadmitmproxy-73b7da1a0360f50e660e1983ec02dd5225bde3a3.tar.gz
mitmproxy-73b7da1a0360f50e660e1983ec02dd5225bde3a3.tar.bz2
mitmproxy-73b7da1a0360f50e660e1983ec02dd5225bde3a3.zip
Fix platform import on Linux using python3
Using python3, sys.platform returns "linux" instead of "linux2" using python2. This patch accepts "linux" as well as "linux2".
-rw-r--r--mitmproxy/platform/__init__.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/mitmproxy/platform/__init__.py b/mitmproxy/platform/__init__.py
index e1ff7c47..2e350131 100644
--- a/mitmproxy/platform/__init__.py
+++ b/mitmproxy/platform/__init__.py
@@ -1,8 +1,9 @@
import sys
+import re
resolver = None
-if sys.platform == "linux2":
+if re.match(r"linux(?:2)?", sys.platform):
from . import linux
resolver = linux.Resolver
elif sys.platform == "darwin":