summaryrefslogtreecommitdiff
path: root/src/flake8/exceptions.py
diff options
context:
space:
mode:
authorIan Cordasco <graffatcolmingov@gmail.com>2016-08-05 06:39:08 -0500
committerIan Cordasco <graffatcolmingov@gmail.com>2016-08-05 06:39:08 -0500
commitf434e9adf5ca8013a63511023d71bf210b0925b9 (patch)
tree9bf6c3724afcee3dbcc7b1d87486b365fea0a517 /src/flake8/exceptions.py
parentcddf982a0a16db11bfb68bd4c620535ac44bcb4b (diff)
downloadflake8-f434e9adf5ca8013a63511023d71bf210b0925b9.tar.gz
Clean up usage of InvalidSyntax exception
Diffstat (limited to 'src/flake8/exceptions.py')
-rw-r--r--src/flake8/exceptions.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/flake8/exceptions.py b/src/flake8/exceptions.py
index 55187bb..da650f9 100644
--- a/src/flake8/exceptions.py
+++ b/src/flake8/exceptions.py
@@ -36,12 +36,17 @@ class InvalidSyntax(Flake8Exception):
def __init__(self, *args, **kwargs):
"""Initialize our InvalidSyntax exception."""
- self.original_exception = exc = kwargs.pop('exception')
- self.error_message = str(exc) if exc is not None else ''
+ exception = kwargs.pop('exception', None)
+ self.original_exception = exception
+ self.error_message = str(exception)
self.error_code = 'E902'
self.line_number = 1
self.column_number = 0
- super(InvalidSyntax, self).__init__(*args, **kwargs)
+ super(InvalidSyntax, self).__init__(
+ self.error_message,
+ *args,
+ **kwargs
+ )
class PluginRequestedUnknownParameters(Flake8Exception):