diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2016-10-20 10:38:57 +1300 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2016-10-20 10:38:57 +1300 |
commit | e0f3cce14cb26d10bc259d431f688fb0d10ab3f5 (patch) | |
tree | d877f8da311782cc84f4add463b5ebcb807b7dbd /netlib/version_check.py | |
parent | 95551265852e6ff05ab5e5204e1a919f66fa4eae (diff) | |
download | mitmproxy-e0f3cce14cb26d10bc259d431f688fb0d10ab3f5.tar.gz mitmproxy-e0f3cce14cb26d10bc259d431f688fb0d10ab3f5.tar.bz2 mitmproxy-e0f3cce14cb26d10bc259d431f688fb0d10ab3f5.zip |
netlib.utils.[get,set]bit -> mitmproxy.utils.bits
Diffstat (limited to 'netlib/version_check.py')
-rw-r--r-- | netlib/version_check.py | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/netlib/version_check.py b/netlib/version_check.py deleted file mode 100644 index 547c031c..00000000 --- a/netlib/version_check.py +++ /dev/null @@ -1,43 +0,0 @@ -""" -Having installed a wrong version of pyOpenSSL or netlib is unfortunately a -very common source of error. Check before every start that both versions -are somewhat okay. -""" -import sys -import inspect -import os.path - -import OpenSSL - -PYOPENSSL_MIN_VERSION = (0, 15) - - -def check_pyopenssl_version(min_version=PYOPENSSL_MIN_VERSION, fp=sys.stderr): - min_version_str = u".".join(str(x) for x in min_version) - try: - v = tuple(int(x) for x in OpenSSL.__version__.split(".")[:2]) - except ValueError: - print( - u"Cannot parse pyOpenSSL version: {}" - u"mitmproxy requires pyOpenSSL {} or greater.".format( - OpenSSL.__version__, min_version_str - ), - file=fp - ) - return - if v < min_version: - print( - u"You are using an outdated version of pyOpenSSL: " - u"mitmproxy requires pyOpenSSL {} or greater.".format(min_version_str), - file=fp - ) - # Some users apparently have multiple versions of pyOpenSSL installed. - # Report which one we got. - pyopenssl_path = os.path.dirname(inspect.getfile(OpenSSL)) - print( - u"Your pyOpenSSL {} installation is located at {}".format( - OpenSSL.__version__, pyopenssl_path - ), - file=fp - ) - sys.exit(1) |