summaryrefslogtreecommitdiffstats
path: root/Tools
diff options
context:
space:
mode:
authorJeremy Hylton <jeremy@alum.mit.edu>2000-02-16 00:51:37 (GMT)
committerJeremy Hylton <jeremy@alum.mit.edu>2000-02-16 00:51:37 (GMT)
commit3d9f5e4de2f3230cc79a92eee7682a74abd52724 (patch)
treeafbbf051cbafa3cb9db788b1c3de0e45bab49e72 /Tools
parent2ce27b223bfa121351dd885acae0e54292926041 (diff)
downloadcpython-3d9f5e4de2f3230cc79a92eee7682a74abd52724.zip
cpython-3d9f5e4de2f3230cc79a92eee7682a74abd52724.tar.gz
cpython-3d9f5e4de2f3230cc79a92eee7682a74abd52724.tar.bz2
more robust assignment of lineno for keyword args
get the lineno from the name of the keyword arg example of case that didn't work-- def foo(x, y, a = None, b = None):
Diffstat (limited to 'Tools')
-rw-r--r--Tools/compiler/compiler/transformer.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Tools/compiler/compiler/transformer.py b/Tools/compiler/compiler/transformer.py
index 9c8b32e..18ec815 100644
--- a/Tools/compiler/compiler/transformer.py
+++ b/Tools/compiler/compiler/transformer.py
@@ -993,9 +993,9 @@ class Transformer:
n = n[1]
if n[0] != token.NAME:
raise SyntaxError, "keyword can't be an expression (%s)"%n[0]
- n = Node('keyword', n[1], result)
- n.lineno = result.lineno
- return 1, n
+ node = Node('keyword', n[1], result)
+ node.lineno = n[2]
+ return 1, node
def com_subscriptlist(self, primary, nodelist, assigning):
# slicing: simple_slicing | extended_slicing