From: Brett Cannon Date: Mon, 9 Jul 2012 17:24:34 +0000 (-0400) Subject: Issue #15256: Re-use the ImportError exception message as defined by X-Git-Tag: v3.3.0b2~261 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bf7eab077fe146dd76f5e7ddad3ff8b2d271fe6c;p=python Issue #15256: Re-use the ImportError exception message as defined by importlib._bootstrap in imp to fix a grammatical mistake. Thanks to Marc Abramowitz for the patch. --- diff --git a/Lib/imp.py b/Lib/imp.py index fcfd3d36ee..f947c3d47d 100644 --- a/Lib/imp.py +++ b/Lib/imp.py @@ -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': diff --git a/Misc/NEWS b/Misc/NEWS index 6d896c247c..727414ff82 100644 --- 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"