mirror of https://github.com/python/cpython.git
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):
This commit is contained in:
parent
2ce27b223b
commit
3d9f5e4de2
|
@ -993,9 +993,9 @@ def com_argument(self, nodelist, kw):
|
|||
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
|
||||
|
|
|
@ -993,9 +993,9 @@ def com_argument(self, nodelist, kw):
|
|||
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
|
||||
|
|
Loading…
Reference in New Issue