emit SET_LINENO for augmented assignments

This commit is contained in:
Jeremy Hylton 2001-08-27 21:58:09 +00:00
parent 2afff324ea
commit 80ea40d858
2 changed files with 8 additions and 0 deletions

View File

@ -117,6 +117,9 @@ def is_constant_false(node):
return 1
return 0
def mangle(name):
return name
class CodeGenerator:
"""Defines basic code generator for Python bytecode
@ -694,6 +697,7 @@ class CodeGenerator:
# augmented assignment
def visitAugAssign(self, node):
self.set_lineno(node)
aug_node = wrap_aug(node.node)
self.visit(aug_node, "load")
self.visit(node.expr)

View File

@ -117,6 +117,9 @@ def is_constant_false(node):
return 1
return 0
def mangle(name):
return name
class CodeGenerator:
"""Defines basic code generator for Python bytecode
@ -694,6 +697,7 @@ class CodeGenerator:
# augmented assignment
def visitAugAssign(self, node):
self.set_lineno(node)
aug_node = wrap_aug(node.node)
self.visit(aug_node, "load")
self.visit(node.expr)