diff options
author | Ceridwen <ceridwenv@gmail.com> | 2015-09-21 16:33:32 -0400 |
---|---|---|
committer | Ceridwen <ceridwenv@gmail.com> | 2015-09-21 16:33:32 -0400 |
commit | 18fc67e6f514daf584137e20857ebd4ef22aa3ad (patch) | |
tree | 4a58c7d4c2abb965f0d66559247065ffe89441ae /astroid/util.py | |
parent | a1dcb2d18a65be6034459832c91bc5eacbee3c1e (diff) | |
download | astroid-git-18fc67e6f514daf584137e20857ebd4ef22aa3ad.tar.gz |
Add helper function for reraising exceptions
Diffstat (limited to 'astroid/util.py')
-rw-r--r-- | astroid/util.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/astroid/util.py b/astroid/util.py index 8dde9b97..ceacb124 100644 --- a/astroid/util.py +++ b/astroid/util.py @@ -19,6 +19,17 @@ # The code in this file was originally part of logilab-common, licensed under # the same license. +import sys + +import six + + +def reraise(exception): + '''Reraises an exception with the traceback from the current exception + block.''' + six.reraise(type(exception), exception, sys.exc_info()[2]) + + class _Yes(object): """Special inference object, which is returned when inference fails.""" def __repr__(self): |