mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-05-05 13:14:46 +00:00
Replace has_key() with 'in' tests to be compatible for Python 3.0
This commit is contained in:
parent
bae348e366
commit
3f38776ce2
2 changed files with 2 additions and 6 deletions
|
|
@ -158,10 +158,6 @@ class CaselessDict (dict):
|
|||
assert isinstance(key, basestring)
|
||||
return dict.__contains__(self, key.lower())
|
||||
|
||||
def has_key (self, key):
|
||||
assert isinstance(key, basestring)
|
||||
return dict.has_key(self, key.lower())
|
||||
|
||||
def get (self, key, def_val=None):
|
||||
assert isinstance(key, basestring)
|
||||
return dict.get(self, key.lower(), def_val)
|
||||
|
|
|
|||
|
|
@ -626,7 +626,7 @@ if options.output:
|
|||
logtype, encoding = options.output.split("/", 1)
|
||||
else:
|
||||
logtype, encoding = options.output, i18n.default_encoding
|
||||
if not linkcheck.logger.Loggers.has_key(logtype.lower()):
|
||||
if logtype.lower() ot in linkcheck.logger.Loggers:
|
||||
print_usage(
|
||||
_("Unknown logger type %(type)r in %(output)r for option %(option)s") % \
|
||||
{"type": logtype, "output": options.output, "option": "'-o, --output'"})
|
||||
|
|
@ -657,7 +657,7 @@ if options.fileoutput:
|
|||
ns['filename'] = suffix
|
||||
else:
|
||||
ns['filename'] = suffix
|
||||
if not linkcheck.logger.Loggers.has_key(ftype):
|
||||
if ftype not in linkcheck.logger.Loggers:
|
||||
print_usage(
|
||||
_("Unknown logger type %(type)r in %(output)r for option %(option)s") % \
|
||||
{"type": ftype, "output": options.output,
|
||||
|
|
|
|||
Loading…
Reference in a new issue