hg
branchstable
changeset 47880 769cd5703b2c
parent 46819 d4ba4d51f85f
child 48875 6000f5b25c9b
equal deleted inserted replaced
47879:c1ed2c967fac 47880:769cd5703b2c
    26 # environment, so no changes are necessary for other platforms.  The Windows
    26 # environment, so no changes are necessary for other platforms.  The Windows
    27 # py2 package uses py2exe, which lacks a `site` module.  Hardcode it according
    27 # py2 package uses py2exe, which lacks a `site` module.  Hardcode it according
    28 # to the documentation.
    28 # to the documentation.
    29 if getattr(sys, 'frozen', None) == 'console_exe':
    29 if getattr(sys, 'frozen', None) == 'console_exe':
    30     vi = sys.version_info
    30     vi = sys.version_info
    31     sys.path.append(
    31     appdata = os.environ.get('APPDATA')
    32         os.path.join(
    32     if appdata:
    33             os.environ['APPDATA'],
    33         sys.path.append(
    34             'Python',
    34             os.path.join(
    35             'Python%d%d' % (vi[0], vi[1]),
    35                 appdata,
    36             'site-packages',
    36                 'Python',
       
    37                 'Python%d%d' % (vi[0], vi[1]),
       
    38                 'site-packages',
       
    39             )
    37         )
    40         )
    38     )
       
    39 
    41 
    40 from hgdemandimport import tracing
    42 from hgdemandimport import tracing
    41 
    43 
    42 with tracing.log('hg script'):
    44 with tracing.log('hg script'):
    43     # enable importing on demand to reduce startup time
    45     # enable importing on demand to reduce startup time