8000 gh-109959: attempt to fix hypothesis tests for `test_glob` by picnixz · Pull Request #128255 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-109959: attempt to fix hypothesis tests for test_glob #128255

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
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
8000
Diff view
12 changes: 4 additions & 8 deletions Lib/glob.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import re
import fnmatch
import functools
import itertools
import operator
import stat
import sys
Expand Down Expand Up @@ -52,13 +51,10 @@ def iglob(pathname, *, root_dir=None, dir_fd=None, recursive=False,
it = _iglob(pathname, root_dir, dir_fd, recursive, False,
include_hidden=include_hidden)
if not pathname or recursive and _isrecursive(pathname[:2]):
try:
s = next(it) # skip empty string
if s:
it = itertools.chain((s,), it)
except StopIteration:
pass
return it
peek = next(it, sentinel := object())
if peek and peek is not sentinel:
yield peek
yield from it

def _iglob(pathname, root_dir, dir_fd, recursive, dironly,
include_hidden=False):
Expand Down
Loading
0