File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -1547,6 +1547,7 @@ def resolve_interpreter(exe):
1547
1547
"""
1548
1548
# If the "executable" is a version number, get the installed executable for
1549
1549
# that version
1550
+ orig_exe = exe
1550
1551
python_versions = get_installed_pythons ()
1551
1552
if exe in python_versions :
1552
1553
exe = python_versions [exe ]
@@ -1558,16 +1559,16 @@ def resolve_interpreter(exe):
1558
1559
exe = join (path , exe )
1559
1560
break
1560
1561
if not os .path .exists (exe ):
1561
- logger .fatal ('The executable %s (from --python=%s) does not exist' % (exe , exe ))
1562
+ logger .fatal ('The path %s (from --python=%s) does not exist' % (exe , orig_exe ))
1562
1563
raise SystemExit (3 )
1563
1564
if not is_executable (exe ):
1564
- logger .fatal ('The executable %s (from --python=%s) is not executable' % (exe , exe ))
1565
+ logger .fatal ('The path %s (from --python=%s) is not an executable file ' % (exe , orig_exe ))
1565
1566
raise SystemExit (3 )
1566
1567
return exe
1567
1568
1568
1569
def is_executable (exe ):
1569
1570
"""Checks a file is executable"""
1570
- return os .access (exe , os .X_OK )
1571
+ return os .path . isfile ( exe ) and os . access (exe , os .X_OK )
1571
1572
1572
1573
############################################################
1573
1574
## Relocating the environment:
You can’t perform that action at this time.
0 commit comments