Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Lib/glob.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ def iglob(pathname, *, recursive=False):
If recursive is true, the pattern '**' will match any files and
zero or more directories and subdirectories.
"""
sys.audit("glob.glob", pathname, recursive)
it = _iglob(pathname, recursive, False)
if recursive and _isrecursive(pathname):
s = next(it) # skip empty string
assert not s
return it

def _iglob(pathname, recursive, dironly):
sys.audit("glob.glob", pathname, recursive)
dirname, basename = os.path.split(pathname)
if not has_magic(pathname):
assert not dironly
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
:func:`sys.audit` is now called only once per call of :func:`glob.glob` and
:func:`glob.iglob`.