diff options
author | Ceridwen <ceridwenv@gmail.com> | 2015-11-06 12:07:52 -0500 |
---|---|---|
committer | Ceridwen <ceridwenv@gmail.com> | 2015-11-06 12:07:52 -0500 |
commit | 9cfa2d038e875e7f112bd9e4fd960d2571c13131 (patch) | |
tree | 92ec454477f17d2cd49737e9ad2bf74a8091ee65 | |
parent | 336760405946c1ee0c8f1dc1e194b69ae73ed857 (diff) | |
download | astroid-9cfa2d038e875e7f112bd9e4fd960d2571c13131.tar.gz |
Use raise directly rather than reraise() in decorators: reraise in this case only adds noise to the tracebacks on 2.7, and when this code is changed to use yield from, there shouldn't be additional tracebacks on 3 either
-rw-r--r-- | astroid/decorators.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/astroid/decorators.py b/astroid/decorators.py index e60eb49..2f02962 100644 --- a/astroid/decorators.py +++ b/astroid/decorators.py @@ -109,9 +109,9 @@ def path_wrapper(func): # Explicit StopIteration to return error information, see # comment in raise_if_nothing_inferred. if len(error.args) > 0: - util.reraise(StopIteration(error.args[0])) + raise StopIteration(error.args[0]) else: - util.reraise(StopIteration()) + raise StopIteration return wrapped @@ -154,6 +154,7 @@ def raise_if_nothing_inferred(func, instance, args, kwargs): except StopIteration as error: if not inferred: if len(error.args) > 0: - util.reraise(exceptions.InferenceError(**error.args[0])) + raise exceptions.InferenceError(**error.args[0]) else: - util.reraise(exceptions.InferenceError()) + raise exceptions.InferenceError( + 'StopIteration raised without any error information.') |