[Updated] D11308: pyoxidizer: add user-site to `sys.path` on Windows
mharbison72 (Matt Harbison)
phabricator at mercurial-scm.org
Wed Aug 25 10:08:25 UTC 2021
Closed by commit rHGc18210649334: pyoxidizer: add user-site to `sys.path` on Windows (authored by mharbison72).
This revision was automatically updated to reflect the committed changes.
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
https://phab.mercurial-scm.org/D11308?vs=29957&id=30012
CHANGES SINCE LAST ACTION
https://phab.mercurial-scm.org/D11308/new/
REVISION DETAIL
https://phab.mercurial-scm.org/D11308
AFFECTED FILES
rust/hgcli/pyoxidizer.bzl
CHANGE DETAILS
diff --git a/rust/hgcli/pyoxidizer.bzl b/rust/hgcli/pyoxidizer.bzl
--- a/rust/hgcli/pyoxidizer.bzl
+++ b/rust/hgcli/pyoxidizer.bzl
@@ -44,6 +44,17 @@
# We do not prepend the values because the Mercurial library wants to be in
# the front of the sys.path to avoid picking up other installations.
sys.path.extend(extra_path.split(os.pathsep))
+# Add user site to sys.path to load extensions without the full path
+if os.name == 'nt':
+ vi = sys.version_info
+ sys.path.append(
+ os.path.join(
+ os.environ['APPDATA'],
+ 'Python',
+ 'Python%d%d' % (vi[0], vi[1]),
+ 'site-packages',
+ )
+ )
import hgdemandimport;
hgdemandimport.enable();
from mercurial import dispatch;
To: mharbison72, #hg-reviewers, Alphare
Cc: marmoute, mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20210825/9a653695/attachment-0002.html>
More information about the Mercurial-patches
mailing list