Skip to content

Commit

Permalink
Avoid exhausting iterator
Browse files Browse the repository at this point in the history
  • Loading branch information
abravalheri committed Jan 20, 2023
1 parent 5f850a2 commit 545ed8b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions setuptools/config/pyprojecttoml.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,9 +314,8 @@ def _expand_directive(
with _ignore_errors(self.ignore_option_errors):
root_dir = self.root_dir
if "file" in directive:
files = always_iterable(directive["file"])
self._referenced_files.update(files)
return _expand.read_files(files, root_dir)
self._referenced_files.update(always_iterable(directive["file"]))
return _expand.read_files(directive["file"], root_dir)
if "attr" in directive:
return _expand.read_attr(directive["attr"], package_dir, root_dir)
raise ValueError(f"invalid `{specifier}`: {directive!r}")
Expand Down

0 comments on commit 545ed8b

Please sign in to comment.