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 | e931c49a7a22d0939dfaea6bf55b485afc6448d3 (patch) | |
tree | fe61781943dca1a92edc54be6d5d6729eda504af | |
parent | a1874fa7b631d7a4538682ccc8242f489c1f3721 (diff) | |
download | astroid-git-e931c49a7a22d0939dfaea6bf55b485afc6448d3.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 e60eb498..2f02962f 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.') |