diff --git a/Lib/ctypes/util.py b/Lib/ctypes/util.py index 433d0d9bf66..35b0b1e50e9 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 diff --git a/Misc/NEWS b/Misc/NEWS index 69078c11a10..f5c7a5e5a07 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -40,6 +40,9 @@ Core and Builtins Library ------- +- Issue #4875: On win32, ctypes.util.find_library does no longer + return directories. + - Issue #5692: In :class:`zipfile.Zipfile`, fix wrong path calculation when extracting a file to the root directory.