From 00cfc379d66c056ed5ac5a9df5b75c86f3fc7fbe Mon Sep 17 00:00:00 2001 From: Thomas Heller Date: Tue, 5 May 2009 19:04:40 +0000 Subject: [PATCH] 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) ........ --- Lib/ctypes/util.py | 4 ++-- Misc/NEWS | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Lib/ctypes/util.py b/Lib/ctypes/util.py index 37e4b037ec4..794b895aa06 100644 --- a/Lib/ctypes/util.py +++ b/Lib/ctypes/util.py @@ -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 diff --git a/Misc/NEWS b/Misc/NEWS index b0948100c6f..c0940f41b58 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -127,6 +127,9 @@ Installation Library ------- +- Issue #4875: On win32, ctypes.util.find_library does no longer + return directories. + - Issue #5142: Add the ability to skip modules while stepping to pdb. - Issue #1309567: Fix linecache behavior of stripping subdirectories when