Replace dict.has_key with the 'in' operator

The deprecated has_key method will be removed from dicts in Python 3.

For custom dict-like classes, has_key() is kept on Python 2,
but disabled for Python 3.

Reviewed-By: Tomas Babej <tbabej@redhat.com>
This commit is contained in:
Petr Viktorin
2015-07-30 17:29:39 +02:00
committed by Tomas Babej
parent 8b88caa110
commit 6a741b51da
14 changed files with 56 additions and 55 deletions

View File

@@ -401,7 +401,7 @@ class API(ReadOnly):
else:
level = 'warning'
if log_mgr.handlers.has_key('console'):
if 'console' in log_mgr.handlers:
log_mgr.remove_handler('console')
log_mgr.create_log_handlers([dict(name='console',
stream=sys.stderr,