##// END OF EJS Templates
setup.py: workaround for missing bz2 module in IronPython...
Zachary Gramana -
r14295:bb7e3b3e default
parent child Browse files
Show More
@@ -4,7 +4,7 b''
4 # 'python setup.py install', or
4 # 'python setup.py install', or
5 # 'python setup.py --help' for more options
5 # 'python setup.py --help' for more options
6
6
7 import sys
7 import sys, platform
8 if not hasattr(sys, 'version_info') or sys.version_info < (2, 4, 0, 'final'):
8 if not hasattr(sys, 'version_info') or sys.version_info < (2, 4, 0, 'final'):
9 raise SystemExit("Mercurial requires Python 2.4 or later.")
9 raise SystemExit("Mercurial requires Python 2.4 or later.")
10
10
@@ -36,11 +36,21 b' except:'
36 raise SystemExit(
36 raise SystemExit(
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
40 isironpython = False
39 try:
41 try:
40 import bz2
42 isironpython = platform.python_implementation().lower().find("ironpython") != -1
41 except:
43 except:
42 raise SystemExit(
44 pass
43 "Couldn't import standard bz2 (incomplete Python install).")
45
46 if isironpython:
47 print "warning: IronPython detected (no bz2 support)"
48 else:
49 try:
50 import bz2
51 except:
52 raise SystemExit(
53 "Couldn't import standard bz2 (incomplete Python install).")
44
54
45 import os, subprocess, time
55 import os, subprocess, time
46 import shutil
56 import shutil
General Comments 0
You need to be logged in to leave comments. Login now