catch value error on codec lookup

git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@3013 e7d03fd6-7b0d-0410-9947-9c21f3af8025
This commit is contained in:
calvin 2006-01-06 15:02:32 +00:00
parent a3ef5f88c4
commit e94c61529b
2 changed files with 2 additions and 2 deletions

View file

@ -294,7 +294,7 @@ def get_ctype_charset (text):
try:
codecs.lookup(charset)
return charset
except LookupError:
except (LookupError, ValueError):
pass
return None

View file

@ -78,7 +78,7 @@ def is_encoding (text):
"""
try:
return codecs.lookup(text)
except LookupError:
except (LookupError, ValueError):
return False