setup.py
changeset 14295 bb7e3b3e6e11
parent 14243 861f28212398
child 14324 d3a49a52f117
equal deleted inserted replaced
14294:84256ba2fbf7 14295:bb7e3b3e6e11
     2 # This is the mercurial setup script.
     2 # This is the mercurial setup script.
     3 #
     3 #
     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 
    11 if sys.version_info[0] >= 3:
    11 if sys.version_info[0] >= 3:
    12     def b(s):
    12     def b(s):
    34     import zlib
    34     import zlib
    35 except:
    35 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
    47 import tempfile
    57 import tempfile
    48 from distutils import log
    58 from distutils import log