aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/pkgutil.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/pkgutil.py')
-rw-r--r--Lib/pkgutil.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/pkgutil.py b/Lib/pkgutil.py
index e37ad451966..9180eaed84d 100644
--- a/Lib/pkgutil.py
+++ b/Lib/pkgutil.py
@@ -119,6 +119,9 @@ def iter_modules(path=None, prefix=''):
"""
if path is None:
importers = iter_importers()
+ elif isinstance(path, str):
+ raise ValueError("path must be None or list of paths to look for "
+ "modules in")
else:
importers = map(get_importer, path)