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/decorators.py | |
parent | 93fb564e69b77c1b697e942f39de3bdd1172399b (diff) | |
download | astroid-5789efaa3963569bc1060cfee5f15726d806e70c.tar.gz |
Add helper function for reraising exceptions
Diffstat (limited to 'astroid/decorators.py')
-rw-r--r-- | astroid/decorators.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/astroid/decorators.py b/astroid/decorators.py index a417527..2303f41 100644 --- a/astroid/decorators.py +++ b/astroid/decorators.py @@ -21,11 +21,10 @@ """ A few useful function/method decorators.""" -import sys - -import six import wrapt +from astroid import util + @wrapt.decorator def cached(func, instance, args, kwargs): @@ -60,9 +59,8 @@ class cachedproperty(object): try: wrapped.__name__ except AttributeError: - six.reraise(TypeError, - TypeError('%s must have a __name__ attribute' % wrapped), - sys.exc_info()[2]) + util.reraise(TypeError('%s must have a __name__ attribute' + % wrapped)) self.wrapped = wrapped @property |