Show More
@@ -84,19 +84,6 b' from distutils.errors import (' | |||
|
84 | 84 | from distutils.sysconfig import get_python_inc, get_config_var |
|
85 | 85 | from distutils.version import StrictVersion |
|
86 | 86 | |
|
87 | convert2to3 = '--c2to3' in sys.argv | |
|
88 | if convert2to3: | |
|
89 | try: | |
|
90 | from distutils.command.build_py import build_py_2to3 as build_py | |
|
91 | from lib2to3.refactor import get_fixers_from_package as getfixers | |
|
92 | except ImportError: | |
|
93 | if sys.version_info[0] < 3: | |
|
94 | raise SystemExit("--c2to3 is only compatible with python3.") | |
|
95 | raise | |
|
96 | sys.path.append('contrib') | |
|
97 | elif sys.version_info[0] >= 3: | |
|
98 | raise SystemExit("setup.py with python3 needs --c2to3 (experimental)") | |
|
99 | ||
|
100 | 87 | scripts = ['hg'] |
|
101 | 88 | if os.name == 'nt': |
|
102 | 89 | # We remove hg.bat if we are able to build hg.exe. |
@@ -235,15 +222,7 b' except ImportError:' | |||
|
235 | 222 | class hgbuild(build): |
|
236 | 223 | # Insert hgbuildmo first so that files in mercurial/locale/ are found |
|
237 | 224 | # when build_py is run next. |
|
238 |
sub_commands = [('build_mo', None) |
|
|
239 | ||
|
240 | # We also need build_ext before build_py. Otherwise, when 2to3 is | |
|
241 | # called (in build_py), it will not find osutil & friends, | |
|
242 | # thinking that those modules are global and, consequently, making | |
|
243 | # a mess, now that all module imports are global. | |
|
244 | ||
|
245 | ('build_ext', build.has_ext_modules), | |
|
246 | ] + build.sub_commands | |
|
225 | sub_commands = [('build_mo', None)] + build.sub_commands | |
|
247 | 226 | |
|
248 | 227 | class hgbuildmo(build): |
|
249 | 228 | |
@@ -282,8 +261,6 b' class hgdist(Distribution):' | |||
|
282 | 261 | global_options = Distribution.global_options + \ |
|
283 | 262 | [('pure', None, "use pure (slow) Python " |
|
284 | 263 | "code instead of C extensions"), |
|
285 | ('c2to3', None, "(experimental!) convert " | |
|
286 | "code with 2to3"), | |
|
287 | 264 | ] |
|
288 | 265 | |
|
289 | 266 | def has_ext_modules(self): |
@@ -328,10 +305,6 b' class hgbuildscripts(build_scripts):' | |||
|
328 | 305 | return build_scripts.run(self) |
|
329 | 306 | |
|
330 | 307 | class hgbuildpy(build_py): |
|
331 | if convert2to3: | |
|
332 | fixer_names = sorted(set(getfixers("lib2to3.fixes") + | |
|
333 | getfixers("hgfixes"))) | |
|
334 | ||
|
335 | 308 | def finalize_options(self): |
|
336 | 309 | build_py.finalize_options(self) |
|
337 | 310 |
General Comments 0
You need to be logged in to leave comments.
Login now