diff options
author | Claudiu Popa <cpopa@cloudbasesolutions.com> | 2015-04-01 12:14:27 +0300 |
---|---|---|
committer | Claudiu Popa <cpopa@cloudbasesolutions.com> | 2015-04-01 12:14:27 +0300 |
commit | 2c75892bf748ed84380066a72770c4553f1c25d8 (patch) | |
tree | 96f669bf6fb6c4be4e771683e78e92aca1e53f37 /pylint/lint.py | |
parent | 9f97a8bfb6333a8ace6dddb3de2ce820f21bc388 (diff) | |
download | pylint-2c75892bf748ed84380066a72770c4553f1c25d8.tar.gz |
The lineno attribute of a SyntaxError can be None when the problem isn't related to a particular line.
Diffstat (limited to 'pylint/lint.py')
-rw-r--r-- | pylint/lint.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/pylint/lint.py b/pylint/lint.py index 39c5cf4..ec03420 100644 --- a/pylint/lint.py +++ b/pylint/lint.py @@ -920,7 +920,7 @@ class PyLinter(configuration.OptionsManagerMixIn, if isinstance(ex.args[0], SyntaxError): ex = ex.args[0] self.add_message('syntax-error', - line=ex.lineno, + line=ex.lineno or 0, args=ex.msg) else: self.add_message('parse-error', args=ex) |