This instance will be upgraded to Heptapod 0.31.0 (final) on 2022-05-24 at 14:00 UTC+2 (a few minutes of down time)

Commit e10f5dc7 authored by Matt Harbison's avatar Matt Harbison
Browse files

pyoxidizer: add the user site to `sys.path` on macOS

This allows 3rd party extensions that are installed with `pip` to be picked up,
similar to what we do on Windows.  PyOxidizer has a bug that prevents this from
working without this extra help (see 95af358fcdfe), though it appears there's
another wrinkle here with `sys._framework` too.

I needed this to see if the problem[1] loading the keyring extension on Windows
also occurs on macOS (it doesn't).


Differential Revision:
parent 7bc1beedd718
......@@ -58,6 +58,20 @@
elif sys.platform == "darwin":
vi = sys.version_info
def joinuser(*args):
return os.path.expanduser(os.path.join(*args))
# Note: uses `sys._framework` instead of hardcoding "Python" as the
# 3rd arg, but that is set to an empty string in an oxidized binary. It
# has a fallback to ~/.local when `sys._framework` isn't set, but we want
# to match what the system python uses, so it sees pip installed stuff.
usersite = joinuser("~", "Library", "Python",
"%d.%d" % vi[:2], "lib/python/site-packages")
import hgdemandimport;
from mercurial import dispatch;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment