Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1acc129

Browse files
committed
Parser/asdl_c.py: use Py_CLEAR()
1 parent ce72e1c commit 1acc129

2 files changed

Lines changed: 135 additions & 270 deletions

File tree

Parser/asdl_c.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -526,8 +526,7 @@ def visitField(self, field, name, sum=None, prod=None, depth=0):
526526
(field.type, field.name), depth+1)
527527
self.emit("if (res != 0) goto failed;", depth+1)
528528

529-
self.emit("Py_XDECREF(tmp);", depth+1)
530-
self.emit("tmp = NULL;", depth+1)
529+
self.emit("Py_CLEAR(tmp);", depth+1)
531530
self.emit("} else {", depth)
532531
if not field.opt:
533532
message = "required field \\\"%s\\\" missing from %s" % (field.name, name)

0 commit comments

Comments
 (0)