setup.py
changeset 36398 eb73f8a6177e
parent 36079 a2a6e724d61a
parent 36386 fb39f6a8a864
child 36426 23d12524a202
equal deleted inserted replaced
36397:7a3590e67868 36398:eb73f8a6177e
    64 Python {py} detected.
    64 Python {py} detected.
    65 {pip}
    65 {pip}
    66 """.format(py=sys.version_info, pip=pip_message)
    66 """.format(py=sys.version_info, pip=pip_message)
    67     printf(error, file=sys.stderr)
    67     printf(error, file=sys.stderr)
    68     sys.exit(1)
    68     sys.exit(1)
       
    69 
       
    70 # We don't yet officially support Python 3. But we want to allow developers to
       
    71 # hack on. Detect and disallow running on Python 3 by default. But provide a
       
    72 # backdoor to enable working on Python 3.
       
    73 if sys.version_info[0] != 2:
       
    74     badpython = True
       
    75 
       
    76     # Allow Python 3 from source checkouts.
       
    77     if os.path.isdir('.hg'):
       
    78         badpython = False
       
    79 
       
    80     if badpython:
       
    81         error = """
       
    82 Mercurial only supports Python 2.7.
       
    83 Python {py} detected.
       
    84 Please re-run with Python 2.7.
       
    85 """.format(py=sys.version_info)
       
    86 
       
    87         printf(error, file=sys.stderr)
       
    88         sys.exit(1)
    69 
    89 
    70 # Solaris Python packaging brain damage
    90 # Solaris Python packaging brain damage
    71 try:
    91 try:
    72     import hashlib
    92     import hashlib
    73     sha = hashlib.sha1()
    93     sha = hashlib.sha1()