Skip to content

Commit

Permalink
Ensure that if the current working directory ('') is present, that it…
Browse files Browse the repository at this point in the history
… remains at the front of sys.path
  • Loading branch information
Ryan Clary committed Jan 5, 2022
1 parent cade5bb commit b67bb0f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions spyder_kernels/customize/spydercustomize.py
Original file line number Diff line number Diff line change
Expand Up @@ -727,6 +727,12 @@ def set_spyder_pythonpath():
pypath = os.environ.get('SPY_PYTHONPATH')
if pypath:
pathlist = pypath.split(os.pathsep)

if '' in sys.path:
# put cwd at front
sys.path.remove('')
pathlist.insert(0, '')

# User provided paths should take priority
[sys.path.insert(0, p) for p in reversed(pathlist)]

Expand Down

0 comments on commit b67bb0f

Please sign in to comment.