aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/command/build_py.py
diff options
context:
space:
mode:
Diffstat (limited to 'setuptools/command/build_py.py')
-rw-r--r--setuptools/command/build_py.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/setuptools/command/build_py.py b/setuptools/command/build_py.py
index 3849b6ad..34f39037 100644
--- a/setuptools/command/build_py.py
+++ b/setuptools/command/build_py.py
@@ -98,10 +98,18 @@ class build_py(orig.build_py, Mixin2to3):
self.package_data.get('', []),
self.package_data.get(package, []),
)
- files = self.manifest_files.get(package, [])[:]
- for pattern in globs:
+ globs_expanded = (
# Each pattern has to be converted to a platform-specific path
- files.extend(glob(os.path.join(src_dir, convert_path(pattern))))
+ glob(os.path.join(src_dir, convert_path(pattern)))
+ for pattern in globs
+ )
+ # flatten the expanded globs into an iterable of matches
+ globs_matches = itertools.chain.from_iterable(globs_expanded)
+ glob_files = globs_matches
+ files = list(itertools.chain(
+ self.manifest_files.get(package, []),
+ glob_files,
+ ))
return self.exclude_data_files(package, src_dir, files)
def build_package_data(self):