Skip to content

Commit 27732f6

Browse files
committed
fix syntax error, sys_path order test
1 parent 8eaafca commit 27732f6

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

python/private/py_executable.bzl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -765,8 +765,6 @@ def _venv_details(*,
765765
# runfiles; runfiles for interpreter-specific files in the venv.
766766
interpreter_runfiles = interpreter_runfiles,
767767
)
768-
)
769-
770768

771769
def _map_each_identity(v):
772770
return v

tests/bootstrap_impls/sys_path_order_test.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,13 @@ def test_sys_path_order(self):
3232
# error messages are more informative.
3333
categorized_paths = []
3434
for i, value in enumerate(sys.path):
35-
# The runtime's root repo may be added to sys.path, but it
36-
# counts as a user directory, not stdlib directory.
37-
if value in (sys.prefix, sys.base_prefix):
35+
# On windows, the `pythonXY.zip` entry shows up as `$venv/Scripts/pythonXY.zip`
36+
# While it's technically part of the venv, it's considered the stdlib.
37+
if os.name == 'nt' and re.search("python.*[.]zip$", value):
38+
category = "stdlib"
39+
elif value in (sys.prefix, sys.base_prefix):
40+
# The runtime's root repo may be added to sys.path, but it
41+
# counts as a user directory, not stdlib directory.
3842
category = "user"
3943
elif value.startswith(sys.base_prefix):
4044
# The runtime's site-package directory might be called

0 commit comments

Comments
 (0)