Commit 6f201707 authored by Serhiy Storchaka's avatar Serhiy Storchaka

Issue #17923: glob() patterns ending with a slash no longer match non-dirs on

AIX.  Based on patch by Delhallt.
parent c04d4683
...@@ -26,11 +26,16 @@ def iglob(pathname): ...@@ -26,11 +26,16 @@ def iglob(pathname):
patterns. patterns.
""" """
dirname, basename = os.path.split(pathname)
if not has_magic(pathname): if not has_magic(pathname):
if os.path.lexists(pathname): if basename:
yield pathname if os.path.lexists(pathname):
yield pathname
else:
# Patterns ending with a slash should match only directories
if os.path.isdir(dirname):
yield pathname
return return
dirname, basename = os.path.split(pathname)
if not dirname: if not dirname:
yield from glob1(None, basename) yield from glob1(None, basename)
return return
......
...@@ -27,6 +27,9 @@ Core and Builtins ...@@ -27,6 +27,9 @@ Core and Builtins
Library Library
------- -------
- Issue #17923: glob() patterns ending with a slash no longer match non-dirs on
AIX. Based on patch by Delhallt.
- Issue #21121: Don't force 3rd party C extensions to be built with - Issue #21121: Don't force 3rd party C extensions to be built with
-Werror=declaration-after-statement. -Werror=declaration-after-statement.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment