aboutsummaryrefslogtreecommitdiff
path: root/mparser.py
diff options
context:
space:
mode:
Diffstat (limited to 'mparser.py')
-rw-r--r--mparser.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/mparser.py b/mparser.py
index 9bc0f2d..0b5ed30 100644
--- a/mparser.py
+++ b/mparser.py
@@ -227,11 +227,13 @@ def p_args_none(t):
t[0] = nodes.Arguments(t.lineno(0))
def p_error(t):
+ lineno = -1
if t is None:
txt = 'NONE'
else:
txt = t.value
- raise ParserException('Parser errored out at: %s.' % txt, t.lineno)
+ lineno = t.lineno
+ raise ParserException('Parser errored out at: %s.' % txt, lineno)
def test_lexer():
s = """hello = (something) # this = (that)