From 545ed8bfffec276ba46aeabfb0fc469eacaf8d91 Mon Sep 17 00:00:00 2001 From: Anderson Bravalheri Date: Fri, 20 Jan 2023 18:02:00 +0000 Subject: Avoid exhausting iterator --- setuptools/config/pyprojecttoml.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'setuptools') diff --git a/setuptools/config/pyprojecttoml.py b/setuptools/config/pyprojecttoml.py index 536247be..9ce55022 100644 --- a/setuptools/config/pyprojecttoml.py +++ b/setuptools/config/pyprojecttoml.py @@ -314,9 +314,8 @@ class _ConfigExpander: 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}") -- cgit v1.2.1