diff options
-rwxr-xr-x | repo | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -1494,6 +1494,14 @@ def main(orig_args): | |||
1494 | if reqs: | 1494 | if reqs: |
1495 | reqs.assert_all() | 1495 | reqs.assert_all() |
1496 | 1496 | ||
1497 | # Python 3.11 introduces PYTHONSAFEPATH and the -P flag which, if enabled, | ||
1498 | # does not prepend the script's directory to sys.path by default. | ||
1499 | # repo relies on this import path, so add directory of REPO_MAIN to | ||
1500 | # PYTHONPATH so that this continues to work when PYTHONSAFEPATH is enabled. | ||
1501 | python_paths = os.environ.get("PYTHONPATH", "").split(os.pathsep) | ||
1502 | new_python_paths = [os.path.join(rel_repo_dir, S_repo)] + python_paths | ||
1503 | os.environ["PYTHONPATH"] = os.pathsep.join(new_python_paths) | ||
1504 | |||
1497 | ver_str = ".".join(map(str, VERSION)) | 1505 | ver_str = ".".join(map(str, VERSION)) |
1498 | me = [ | 1506 | me = [ |
1499 | sys.executable, | 1507 | sys.executable, |