Skip to content

Commit

Permalink
Add comment, remove redundant check
Browse files Browse the repository at this point in the history
  • Loading branch information
barneygale committed Feb 8, 2025
1 parent 46429ad commit f160e8c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Lib/glob.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,13 +332,14 @@ def select_wildcard(path, dir_fd=None, rel_path=None, exists=False):
continue
except OSError:
continue
if dir_only:
entry_path = self.concat_path(entry_path, self.sep)
if fd is not None:
entry_name = entry_name + self.sep
yield from select_next(
entry_path, fd, entry_name, exists=True)
else:
# Optimization: directly yield the path if this is
# last pattern part.
yield entry_path
finally:
if fd is not None:
Expand Down

0 comments on commit f160e8c

Please sign in to comment.