Show More
@@ -67,6 +67,26 b' Python {py} detected.' | |||
|
67 | 67 | printf(error, file=sys.stderr) |
|
68 | 68 | sys.exit(1) |
|
69 | 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) | |
|
89 | ||
|
70 | 90 | # Solaris Python packaging brain damage |
|
71 | 91 | try: |
|
72 | 92 | import hashlib |
General Comments 0
You need to be logged in to leave comments.
Login now