diff options
author | Brett Cannon <brett@python.org> | 2011-03-23 23:06:00 (GMT) |
---|---|---|
committer | Brett Cannon <brett@python.org> | 2011-03-23 23:06:00 (GMT) |
commit | a7468bc5c6153784fb9ab35baf030162208d852d (patch) | |
tree | a4aca9e4cf68517aa017d2e5dc563841201dc681 /Lib/importlib/_bootstrap.py | |
parent | f3c524d535965ec964ea497290aebc0d1e10bb66 (diff) | |
download | cpython-a7468bc5c6153784fb9ab35baf030162208d852d.zip cpython-a7468bc5c6153784fb9ab35baf030162208d852d.tar.gz cpython-a7468bc5c6153784fb9ab35baf030162208d852d.tar.bz2 |
Have importlib use the repr of a module name in error messages.
This makes it obvious that an import failed because of some extraneous
whitespace (e.g., a newline).
This is a partial fix for issue #8754.
Diffstat (limited to 'Lib/importlib/_bootstrap.py')
-rw-r--r-- | Lib/importlib/_bootstrap.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/importlib/_bootstrap.py b/Lib/importlib/_bootstrap.py index a944bee..f2ef1cf 100644 --- a/Lib/importlib/_bootstrap.py +++ b/Lib/importlib/_bootstrap.py @@ -758,7 +758,7 @@ class _ImportLockContext: _IMPLICIT_META_PATH = [BuiltinImporter, FrozenImporter, _DefaultPathFinder] -_ERR_MSG = 'No module named {}' +_ERR_MSG = 'No module named {!r}' def _gcd_import(name, package=None, level=0): """Import and return the module based on its name, the package the call is |