mirror of https://github.com/python/cpython.git
Merged revisions 72352 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r72352 | thomas.heller | 2009-05-05 20:55:47 +0200 (Di, 05 Mai 2009) | 3 lines Fix Issue #4875: find_library can return directories instead of files (on win32) ........
This commit is contained in:
parent
690ce9b353
commit
00cfc379d6
|
@ -49,12 +49,12 @@ def find_library(name):
|
|||
# See MSDN for the REAL search order.
|
||||
for directory in os.environ['PATH'].split(os.pathsep):
|
||||
fname = os.path.join(directory, name)
|
||||
if os.path.exists(fname):
|
||||
if os.path.isfile(fname):
|
||||
return fname
|
||||
if fname.lower().endswith(".dll"):
|
||||
continue
|
||||
fname = fname + ".dll"
|
||||
if os.path.exists(fname):
|
||||
if os.path.isfile(fname):
|
||||
return fname
|
||||
return None
|
||||
|
||||
|
|
Loading…
Reference in New Issue