Merge pull request #1358 from xonsh/path34

path fix for v3.4
This commit is contained in:
Morten Enemark Lund 2016-06-29 12:15:17 +02:00 committed by GitHub
commit e20b9b3008
2 changed files with 17 additions and 1 deletions

14
news/path34.rst Normal file
View file

@ -0,0 +1,14 @@
**Added:** None
**Changed:** None
**Deprecated:** None
**Removed:** None
**Fixed:**
* No longer raises an error if a directory in ``$PATH`` does not exist on
Python v3.4.
**Security:** None

View file

@ -482,7 +482,9 @@ def _yield_accessible_unix_file_names(path):
def _executables_in_posix(path): def _executables_in_posix(path):
if PYTHON_VERSION_INFO < (3, 5, 0): if not os.path.exists(path):
return
elif PYTHON_VERSION_INFO < (3, 5, 0):
for fname in os.listdir(path): for fname in os.listdir(path):
fpath = os.path.join(path, fname) fpath = os.path.join(path, fname)
if (os.path.exists(fpath) and if (os.path.exists(fpath) and