Skip to content

Commit 1d367ee

Browse files
committed
Raise an explicit type error in build_py.build_packages if self.packages is None
1 parent ac41e61 commit 1d367ee

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

distutils/command/build_py.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,11 @@ def build_modules(self) -> None:
360360
self.build_module(module, module_file, package)
361361

362362
def build_packages(self) -> None:
363-
for package in self.packages or ():
363+
if self.packages is None:
364+
raise TypeError(
365+
f"{type(self).__name__}.packages is None. Is the Distribution missing packages ?"
366+
)
367+
for package in self.packages:
364368
# Get list of (package, module, module_file) tuples based on
365369
# scanning the package directory. 'package' is only included
366370
# in the tuple so that 'find_modules()' and

0 commit comments

Comments
 (0)