Skip to content

Commit

Permalink
some small obvious corrections
Browse files Browse the repository at this point in the history
--HG--
branch : rebuild
  • Loading branch information
Emile Anclin committed Dec 16, 2009
1 parent 1117640 commit c3a35e5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion _nodes_ast.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ def _visit_assign(self, node):
def visit_augassign(self, node):
"""visit a AugAssign node by returning a fresh instance of it"""
newnode = new.AugAssign()
newnode.op = _BIN_OP_CLASSES[node.op.__class__]
newnode.target = self.visit(node.target, node)
newnode.value = self.visit(node.value, node)
return newnode
Expand Down Expand Up @@ -237,7 +238,7 @@ def visit_callfunc(self, node):
newnode.args = [self.visit(child, node) for child in node.args]
newnode.starargs = self.visit(node.starargs, node)
newnode.kwargs = self.visit(node.kwargs, node)
newnode.args.extend(node.keywords)
newnode.args.extend(self.visit(child, node) for child in node.keywords)
return newnode

def _visit_class(self, node):
Expand Down Expand Up @@ -422,6 +423,7 @@ def visit_index(self, node):
def visit_keyword(self, node):
"""visit a Keyword node by returning a fresh instance of it"""
newnode = new.Keyword()
newnode.arg = node.arg
newnode.value = self.visit(node.value, node)
return newnode

Expand Down
2 changes: 1 addition & 1 deletion node_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ class From(FromImportMixIn, StmtMixIn, NodeNG):
"""class representing a From node"""

def __init__(self, fromname, names):
self.fromname = fromname
self.modname = fromname
self.names = names

class Getattr(NodeNG):
Expand Down
2 changes: 1 addition & 1 deletion nodes_as_string.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def visit_assign(self, node):

def visit_augassign(self, node):
"""return an astng.AugAssign node as string"""
return '%s %s %s' % (node.target.accept(self), node.op, node.value.accept(self))
return '%s %s= %s' % (node.target.accept(self), node.op, node.value.accept(self))

def visit_backquote(self, node):
"""return an astng.Backquote node as string"""
Expand Down

0 comments on commit c3a35e5

Please sign in to comment.