Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions spyder/plugins/pythonpath/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ def test_check_path(tmp_path):
assert not check_path('lib\\dist-packages')
assert not check_path('Lib/site-packages')
assert not check_path('Anaconda3/pkgs')
assert not check_path("C:\\Users\\user\\AppData\\Roaming\\Python\\Scripts")
else:
# One digit Python versions
assert not check_path('lib/python3.9/site-packages')
Expand Down
4 changes: 3 additions & 1 deletion spyder/plugins/pythonpath/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@ def check_path(path):
"""
pattern_string = r'(ana|mini|micro)(conda|mamba|forge)\d*(/base)*/pkgs'
if os.name == 'nt':
path_appdata = os.getenv("APPDATA").replace('\\', '/')
pattern_string = (
f'.*({pattern_string}'
r'|(l|L)ib/(site|dist)-packages).*'
r'|(l|L)ib/(site|dist)-packages.*'
f'|(AppData|{path_appdata})/Roaming/Python).*'
)
else:
pattern_string = (
Expand Down
Loading