Show More
@@ -6,17 +6,12 b'' | |||
|
6 | 6 | |
|
7 | 7 | import os |
|
8 | 8 | |
|
9 | supportedpy = '~= 2.7' | |
|
10 | if os.environ.get('HGALLOWPYTHON3', ''): | |
|
11 | 9 |
|
|
12 | 10 |
|
|
13 | 11 |
|
|
14 | 12 |
|
|
15 | 13 |
|
|
16 | 14 |
|
|
17 | # | |
|
18 | # TODO: when we actually work on Python 3, use this string as the | |
|
19 | # actual supportedpy string. | |
|
20 | 15 |
|
|
21 | 16 |
|
|
22 | 17 |
|
@@ -89,39 +84,6 b' Python {py} detected.' | |||
|
89 | 84 | printf(error, file=sys.stderr) |
|
90 | 85 | sys.exit(1) |
|
91 | 86 | |
|
92 | # We don't yet officially support Python 3. But we want to allow developers to | |
|
93 | # hack on. Detect and disallow running on Python 3 by default. But provide a | |
|
94 | # backdoor to enable working on Python 3. | |
|
95 | if sys.version_info[0] != 2: | |
|
96 | badpython = True | |
|
97 | ||
|
98 | # Allow Python 3 from source checkouts. | |
|
99 | if os.path.isdir('.hg') or 'HGPYTHON3' in os.environ: | |
|
100 | badpython = False | |
|
101 | ||
|
102 | if badpython: | |
|
103 | error = """ | |
|
104 | Python {py} detected. | |
|
105 | ||
|
106 | Mercurial currently has beta support for Python 3 and use of Python 2.7 is | |
|
107 | recommended for the best experience. | |
|
108 | ||
|
109 | Please re-run with Python 2.7 for a faster, less buggy experience. | |
|
110 | ||
|
111 | If you would like to beta test Mercurial with Python 3, this error can | |
|
112 | be suppressed by defining the HGPYTHON3 environment variable when invoking | |
|
113 | this command. No special environment variables or configuration changes are | |
|
114 | necessary to run `hg` with Python 3. | |
|
115 | ||
|
116 | See https://www.mercurial-scm.org/wiki/Python3 for more on Mercurial's | |
|
117 | Python 3 support. | |
|
118 | """.format( | |
|
119 | py='.'.join('%d' % x for x in sys.version_info[0:2]) | |
|
120 | ) | |
|
121 | ||
|
122 | printf(error, file=sys.stderr) | |
|
123 | sys.exit(1) | |
|
124 | ||
|
125 | 87 | if sys.version_info[0] >= 3: |
|
126 | 88 | DYLIB_SUFFIX = sysconfig.get_config_vars()['EXT_SUFFIX'] |
|
127 | 89 | else: |
General Comments 0
You need to be logged in to leave comments.
Login now