]> granicus.if.org Git - python/commitdiff
Issue #15256: Re-use the ImportError exception message as defined by
authorBrett Cannon <brett@python.org>
Mon, 9 Jul 2012 17:24:34 +0000 (13:24 -0400)
committerBrett Cannon <brett@python.org>
Mon, 9 Jul 2012 17:24:34 +0000 (13:24 -0400)
importlib._bootstrap in imp to fix a grammatical mistake.

Thanks to Marc Abramowitz for the patch.

Lib/imp.py
Misc/NEWS

index fcfd3d36ee1a8cc574612868d8932e3bf3f23c73..f947c3d47de9a1858bfc925d571ef3a3e555a9d6 100644 (file)
@@ -230,7 +230,7 @@ def find_module(name, path=None):
                 continue
             break  # Break out of outer loop when breaking out of inner loop.
     else:
-        raise ImportError('No module name {!r}'.format(name), name=name)
+        raise ImportError(_bootstrap._ERR_MSG.format(name), name=name)
 
     encoding = None
     if mode == 'U':
index 6d896c247ce1f77bc85ebdd8d0835ee0613fa024..727414ff8250f9a7c1873243dd5a887c1a3a4124 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -31,6 +31,8 @@ Core and Builtins
 Library
 -------
 
+- Issue #15256: Grammatical mistake in exception raised by imp.find_module().
+
 - Issue #5931: wsgiref environ variable SERVER_SOFTWARE will specify an
   implementation specific term like Cpython, Jython instead of generic "Python"