Bug #1446043: correctly raise a LookupError if an encoding name given

to encodings.search_function() contains a dot.
 (backport from rev. 52075)
This commit is contained in:
Georg Brandl 2006-09-30 11:22:35 +00:00
parent 6d7c36332f
commit 1206a933cc
2 changed files with 4 additions and 1 deletions

View File

@ -90,7 +90,7 @@ def search_function(encoding):
else:
modnames = [norm_encoding]
for modname in modnames:
if not modname:
if not modname or '.' in modname:
continue
try:
mod = __import__('encodings.' + modname,

View File

@ -44,6 +44,9 @@ Extension Modules
Library
-------
- Bug #1446043: correctly raise a LookupError if an encoding name given
to encodings.search_function() contains a dot.
- Bug #1560617: in pyclbr, return full module name not only for classes,
but also for functions.