aboutsummaryrefslogtreecommitdiffstats
path: root/mitmproxy/tools/main.py
blob: cd99e6d5f799db1d8b7fd80f10df895e3a80484f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
"""
This file must be kept in a python2.7 and python3.5 compatible syntax!
DO NOT use type annotations or other python3.6-only features that makes this file unparsable by older interpreters!
"""

from __future__ import print_function  # this is here for the version check to work on Python 2.

import sys

if sys.version_info < (3, 6):
    # This must be before any mitmproxy imports, as they already break!
    # Keep all other imports below with the 'noqa' magic comment.
    print("#" * 76, file=sys.stderr)
    print("# mitmproxy requires Python 3.6 or higher!                                 #", file=sys.stderr)
    print("#" + " " * 74 + "#", file=sys.stderr)
    print("# Please upgrade your Python intepreter or use our mitmproxy binaries from #", file=sys.stderr)
    print("# https://mitmproxy.org. If your operating system does not include the     #", file=sys.stderr)
    print("# required Python version, you can try using pyenv or similar tools.       #", file=sys.stderr)
    print("#" * 76, file=sys.stderr)
    sys.exit(1)
else:
    from ._main import *  # noqa