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>
This commit is contained in:
Petr Viktorin 2015-08-12 14:06:54 +02:00 committed by Jan Cholasta
parent d1187cbc6f
commit 9e917cae39
2 changed files with 4 additions and 10 deletions

View File

@ -10,6 +10,8 @@ import sys
import abc import abc
import itertools import itertools
import six
from ipapython.ipa_log_manager import root_logger from ipapython.ipa_log_manager import root_logger
from . import util from . import util
@ -361,7 +363,7 @@ class Configurable(object):
def _handle_exception(self, exc_info): def _handle_exception(self, exc_info):
assert not hasattr(super(Configurable, self), '_handle_exception') 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): def __transition(self, from_state, to_state):
if self.__state != from_state: if self.__state != from_state:

View File

@ -11,14 +11,6 @@ import sys
import six 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): class from_(object):
""" """
Wrapper for delegating to a subgenerator. Wrapper for delegating to a subgenerator.
@ -86,7 +78,7 @@ def run_generator_with_yield_from(gen):
exc_info = sys.exc_info() exc_info = sys.exc_info()
if exc_info is not None: if exc_info is not None:
raise_exc_info(exc_info) six.reraise(*exc_info)
class InnerClassMeta(type): class InnerClassMeta(type):