mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
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.
This commit is contained in:
parent
f3c524d535
commit
a7468bc5c6
2 changed files with 3 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue