mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2024-12-23 07:33:27 -06:00
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:
parent
d1187cbc6f
commit
9e917cae39
@ -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:
|
||||
|
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user