修复配置PATHEXT最后一个字符如果是分号的情况。

This commit is contained in:
enoch 2012-09-05 18:04:09 +08:00
parent 0c599b68e8
commit 5230dd2016
1 changed files with 1 additions and 1 deletions

View File

@ -87,7 +87,7 @@ def find_command(cmd, paths=None, pathext=None):
# check if there are funny path extensions for executables, e.g. Windows
if pathext is None:
pathext = get_pathext()
pathext = [ext for ext in pathext.lower().split(os.pathsep)]
pathext = [ext for ext in pathext.lower().split(os.pathsep) if len(ext)]
# don't use extensions if the command ends with one of them
if os.path.splitext(cmd)[1].lower() in pathext:
pathext = ['']