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 | 5789efaa3963569bc1060cfee5f15726d806e70c (patch) | |
tree | 34806989657c0f66f1afb338d1fc8508ce18909b /astroid/util.py | |
parent | 93fb564e69b77c1b697e942f39de3bdd1172399b (diff) | |
download | astroid-5789efaa3963569bc1060cfee5f15726d806e70c.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 8dde9b9..ceacb12 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): |