diff --git a/setuptools/config/pyprojecttoml.py b/setuptools/config/pyprojecttoml.py index 536247be48..9ce550222c 100644 --- a/setuptools/config/pyprojecttoml.py +++ b/setuptools/config/pyprojecttoml.py @@ -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}")