equal
deleted
inserted
replaced
19 os.path.dirname(os.path.realpath(__file__)), libdir |
19 os.path.dirname(os.path.realpath(__file__)), libdir |
20 ) |
20 ) |
21 libdir = os.path.abspath(libdir) |
21 libdir = os.path.abspath(libdir) |
22 sys.path.insert(0, libdir) |
22 sys.path.insert(0, libdir) |
23 |
23 |
|
24 # Make `pip install --user ...` packages available to the official Windows |
|
25 # build. Most py2 packaging installs directly into the system python |
|
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 |
|
28 # to the documentation. |
|
29 if getattr(sys, 'frozen', None) == 'console_exe': |
|
30 vi = sys.version_info |
|
31 sys.path.append( |
|
32 os.path.join( |
|
33 os.environ['APPDATA'], |
|
34 'Python', |
|
35 'Python%d%d' % (vi[0], vi[1]), |
|
36 'site-packages', |
|
37 ) |
|
38 ) |
|
39 |
24 from hgdemandimport import tracing |
40 from hgdemandimport import tracing |
25 |
41 |
26 with tracing.log('hg script'): |
42 with tracing.log('hg script'): |
27 # enable importing on demand to reduce startup time |
43 # enable importing on demand to reduce startup time |
28 try: |
44 try: |