diff options
author | Petr Viktorin <pviktori@redhat.com> | 2015-08-12 14:06:54 +0200 |
---|---|---|
committer | Jan Cholasta <jcholast@redhat.com> | 2015-09-01 11:42:01 +0200 |
commit | 9e917cae39e266fb3092e5ab212a99968de996c2 (patch) | |
tree | fef43a32eabbdc176ced6254bad3dfc5b36a175d /ipapython/install | |
parent | d1187cbc6ffc855e1bd42cd65110ba0567293ce6 (diff) | |
download | freeipa-9e917cae39e266fb3092e5ab212a99968de996c2.tar.gz freeipa-9e917cae39e266fb3092e5ab212a99968de996c2.tar.xz freeipa-9e917cae39e266fb3092e5ab212a99968de996c2.zip |
Use six.reraise
The three-argument raise is going away in Python 3. Use the six.reraise
helper instead.
Reviewed-By: Christian Heimes <cheimes@redhat.com>
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
Diffstat (limited to 'ipapython/install')
-rw-r--r-- | ipapython/install/core.py | 4 | ||||
-rw-r--r-- | ipapython/install/util.py | 10 |
2 files changed, 4 insertions, 10 deletions
diff --git a/ipapython/install/core.py b/ipapython/install/core.py index 92ad12c7f..f4b2806ea 100644 --- a/ipapython/install/core.py +++ b/ipapython/install/core.py @@ -10,6 +10,8 @@ import sys import abc import itertools +import six + from ipapython.ipa_log_manager import root_logger from . import util @@ -361,7 +363,7 @@ class Configurable(object): def _handle_exception(self, exc_info): assert not hasattr(super(Configurable, self), '_handle_exception') - util.raise_exc_info(exc_info) + six.reraise(*exc_info) def __transition(self, from_state, to_state): if self.__state != from_state: diff --git a/ipapython/install/util.py b/ipapython/install/util.py index 12530d45a..d86db218b 100644 --- a/ipapython/install/util.py +++ b/ipapython/install/util.py @@ -11,14 +11,6 @@ import sys import six -def raise_exc_info(exc_info): - """ - Raise exception from exception info tuple as returned by `sys.exc_info()`. - """ - - raise exc_info[0], exc_info[1], exc_info[2] - - class from_(object): """ Wrapper for delegating to a subgenerator. @@ -86,7 +78,7 @@ def run_generator_with_yield_from(gen): exc_info = sys.exc_info() if exc_info is not None: - raise_exc_info(exc_info) + six.reraise(*exc_info) class InnerClassMeta(type): |