Mercurial > hg
comparison setup.py @ 16683:525fdb738975
cleanup: eradicate long lines
author | Brodie Rao <brodie@sf.io> |
---|---|
date | Sat, 12 May 2012 15:54:54 +0200 |
parents | f5dd179bfa4a |
children | cfb6682961b8 |
comparison
equal
deleted
inserted
replaced
16676:654b9e1966f7 | 16683:525fdb738975 |
---|---|
37 "Couldn't import standard zlib (incomplete Python install).") | 37 "Couldn't import standard zlib (incomplete Python install).") |
38 | 38 |
39 # The base IronPython distribution (as of 2.7.1) doesn't support bz2 | 39 # The base IronPython distribution (as of 2.7.1) doesn't support bz2 |
40 isironpython = False | 40 isironpython = False |
41 try: | 41 try: |
42 isironpython = platform.python_implementation().lower().find("ironpython") != -1 | 42 isironpython = (platform.python_implementation() |
43 .lower().find("ironpython") != -1) | |
43 except: | 44 except: |
44 pass | 45 pass |
45 | 46 |
46 if isironpython: | 47 if isironpython: |
47 sys.stderr.write("warning: IronPython detected (no bz2 support)\n") | 48 sys.stderr.write("warning: IronPython detected (no bz2 support)\n") |
209 | 210 |
210 class hgbuild(build): | 211 class hgbuild(build): |
211 # Insert hgbuildmo first so that files in mercurial/locale/ are found | 212 # Insert hgbuildmo first so that files in mercurial/locale/ are found |
212 # when build_py is run next. | 213 # when build_py is run next. |
213 sub_commands = [('build_mo', None), | 214 sub_commands = [('build_mo', None), |
214 # We also need build_ext before build_py. Otherwise, when 2to3 is called (in | 215 |
215 # build_py), it will not find osutil & friends, thinking that those modules are | 216 # We also need build_ext before build_py. Otherwise, when 2to3 is |
216 # global and, consequently, making a mess, now that all module imports are | 217 # called (in build_py), it will not find osutil & friends, |
217 # global. | 218 # thinking that those modules are global and, consequently, making |
219 # a mess, now that all module imports are global. | |
220 | |
218 ('build_ext', build.has_ext_modules), | 221 ('build_ext', build.has_ext_modules), |
219 ] + build.sub_commands | 222 ] + build.sub_commands |
220 | 223 |
221 class hgbuildmo(build): | 224 class hgbuildmo(build): |
222 | 225 |
290 if ext.name.startswith("mercurial."): | 293 if ext.name.startswith("mercurial."): |
291 self.py_modules.append("mercurial.pure.%s" % ext.name[10:]) | 294 self.py_modules.append("mercurial.pure.%s" % ext.name[10:]) |
292 self.distribution.ext_modules = [] | 295 self.distribution.ext_modules = [] |
293 else: | 296 else: |
294 if not os.path.exists(os.path.join(get_python_inc(), 'Python.h')): | 297 if not os.path.exists(os.path.join(get_python_inc(), 'Python.h')): |
295 raise SystemExit("Python headers are required to build Mercurial") | 298 raise SystemExit('Python headers are required to build ' |
299 'Mercurial') | |
296 | 300 |
297 def find_modules(self): | 301 def find_modules(self): |
298 modules = build_py.find_modules(self) | 302 modules = build_py.find_modules(self) |
299 for module in modules: | 303 for module in modules: |
300 if module[0] == "mercurial.pure": | 304 if module[0] == "mercurial.pure": |