summaryrefslogtreecommitdiffstats
path: root/Lib/ctypes
diff options
context:
space:
mode:
authorThomas Heller <theller@ctypes.org>2009-05-05 18:55:47 (GMT)
committerThomas Heller <theller@ctypes.org>2009-05-05 18:55:47 (GMT)
commita57773e4838112ab44e55d985b68810fecf934a3 (patch)
tree48ddc03979cc1e6da9b2423e2f28378622f7535a /Lib/ctypes
parenta985a3aee46dfda4b59cf20414bab199ba1b9659 (diff)
downloadcpython-a57773e4838112ab44e55d985b68810fecf934a3.zip
cpython-a57773e4838112ab44e55d985b68810fecf934a3.tar.gz
cpython-a57773e4838112ab44e55d985b68810fecf934a3.tar.bz2
Fix Issue #4875: find_library can return directories instead of files
(on win32)
Diffstat (limited to 'Lib/ctypes')
-rw-r--r--Lib/ctypes/util.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/ctypes/util.py b/Lib/ctypes/util.py
index 433d0d9..35b0b1e 100644
--- a/Lib/ctypes/util.py
+++ b/Lib/ctypes/util.py
@@ -52,12 +52,12 @@ if os.name == "nt":
# 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