summaryrefslogtreecommitdiffstats
path: root/ipalib/plugable.py
diff options
context:
space:
mode:
authorPetr Viktorin <pviktori@redhat.com>2015-07-30 16:49:29 +0200
committerTomas Babej <tbabej@redhat.com>2015-08-12 18:17:23 +0200
commit27dabb45282911e375336f75934af9dd6cc5d963 (patch)
tree3c8fe5255d60613fa9cd14d053b3688feed740c9 /ipalib/plugable.py
parenta651be3eec2a08bd2865b16b0eed767db69aab0f (diff)
downloadfreeipa-27dabb45282911e375336f75934af9dd6cc5d963.tar.gz
freeipa-27dabb45282911e375336f75934af9dd6cc5d963.tar.xz
freeipa-27dabb45282911e375336f75934af9dd6cc5d963.zip
Modernize 'except' clauses
The 'as' syntax works from Python 2 on, and Python 3 will drop the "comma" syntax. Reviewed-By: Tomas Babej <tbabej@redhat.com>
Diffstat (limited to 'ipalib/plugable.py')
-rw-r--r--ipalib/plugable.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/ipalib/plugable.py b/ipalib/plugable.py
index 45b346376..8b82b60f8 100644
--- a/ipalib/plugable.py
+++ b/ipalib/plugable.py
@@ -429,7 +429,7 @@ class API(ReadOnly):
filename=self.env.log,
level=level,
format=LOGGING_FORMAT_FILE)])
- except IOError, e:
+ except IOError as e:
log.error('Cannot open log file %r: %s', self.env.log, e)
return
@@ -541,7 +541,7 @@ class API(ReadOnly):
subpackage = module[:-2]
try:
plugins = importlib.import_module(subpackage)
- except ImportError, e:
+ except ImportError as e:
self.log.error("cannot import plugins sub-package %s: %s",
subpackage, e)
raise
@@ -565,9 +565,9 @@ class API(ReadOnly):
self.log.debug("importing plugin module %s", name)
try:
module = importlib.import_module(name)
- except errors.SkipPluginModule, e:
+ except errors.SkipPluginModule as e:
self.log.debug("skipping plugin module %s: %s", name, e.reason)
- except StandardError, e:
+ except StandardError as e:
if self.env.startup_traceback:
import traceback
self.log.error("could not load plugin module %s\n%s", name,