Skip to content

Commit

Permalink
Address some review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
barneygale committed Sep 1, 2024
1 parent ee76faf commit 4cf8a4d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Lib/glob.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,10 @@ def select_recursive(path, dir_fd=None, rel_path=None, exists=False):
while stack:
path, dir_fd, rel_path = stack.pop()
if path is None:
self.close(dir_fd)
try:
self.close(dir_fd)
except OSError:
pass

def select_recursive_step(stack, match_pos):
path, dir_fd, rel_path = stack.pop()
Expand Down Expand Up @@ -440,7 +443,8 @@ def select_recursive_step(stack, match_pos):
return select_recursive

def select_exists(self, path, dir_fd=None, rel_path=None, exists=False):
"""Yields the given path, if it exists.
"""Yields the given path, if it exists. If *dir_fd* is given, we check
whether *rel_path* exists relative to the fd.
"""
if exists:
# Optimization: this path is already known to exist, e.g. because
Expand Down

0 comments on commit 4cf8a4d

Please sign in to comment.