Skip to content

Commit

Permalink
Parser/asdl_c.py: use Py_CLEAR()
Browse files Browse the repository at this point in the history
  • Loading branch information
vstinner committed Jul 26, 2013
1 parent ce72e1c commit 1acc129
Show file tree
Hide file tree
Showing 2 changed files with 135 additions and 270 deletions.
3 changes: 1 addition & 2 deletions Parser/asdl_c.py
Original file line number Diff line number Diff line change
Expand Up @@ -526,8 +526,7 @@ def visitField(self, field, name, sum=None, prod=None, depth=0):
(field.type, field.name), depth+1)
self.emit("if (res != 0) goto failed;", depth+1)

self.emit("Py_XDECREF(tmp);", depth+1)
self.emit("tmp = NULL;", depth+1)
self.emit("Py_CLEAR(tmp);", depth+1)
self.emit("} else {", depth)
if not field.opt:
message = "required field \\\"%s\\\" missing from %s" % (field.name, name)
Expand Down
Loading

0 comments on commit 1acc129

Please sign in to comment.