summaryrefslogtreecommitdiffstats
path: root/Parser
diff options
context:
space:
mode:
authorYuan Chao Chou <oswinchou@gmail.com>2017-08-04 17:53:12 (GMT)
committerƁukasz Langa <lukasz@langa.pl>2017-08-04 17:53:12 (GMT)
commit2af565baf498f389105ff71e4ae054c66fe5d55f (patch)
treeb0cde972b597613b4e0c21027572d98a70a749c9 /Parser
parentc4c9866064f03646c686d7e08b00aeb203c35c19 (diff)
downloadcpython-2af565baf498f389105ff71e4ae054c66fe5d55f.zip
cpython-2af565baf498f389105ff71e4ae054c66fe5d55f.tar.gz
cpython-2af565baf498f389105ff71e4ae054c66fe5d55f.tar.bz2
Fix a shadow-compatible-local warning (#2180)
Change the shadowing naming, 'value' (Python-ast.c:4652), to 'val' to prevent the variables from being misused.
Diffstat (limited to 'Parser')
-rw-r--r--Parser/asdl_c.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Parser/asdl_c.py b/Parser/asdl_c.py
index 096f5f8..b367e10 100644
--- a/Parser/asdl_c.py
+++ b/Parser/asdl_c.py
@@ -522,8 +522,8 @@ class Obj2ModVisitor(PickleVisitor):
self.emit("%s = _Py_asdl_seq_new(len, arena);" % field.name, depth+1)
self.emit("if (%s == NULL) goto failed;" % field.name, depth+1)
self.emit("for (i = 0; i < len; i++) {", depth+1)
- self.emit("%s value;" % ctype, depth+2)
- self.emit("res = obj2ast_%s(PyList_GET_ITEM(tmp, i), &value, arena);" %
+ self.emit("%s val;" % ctype, depth+2)
+ self.emit("res = obj2ast_%s(PyList_GET_ITEM(tmp, i), &val, arena);" %
field.type, depth+2, reflow=False)
self.emit("if (res != 0) goto failed;", depth+2)
self.emit("if (len != PyList_GET_SIZE(tmp)) {", depth+2)
@@ -533,7 +533,7 @@ class Obj2ModVisitor(PickleVisitor):
depth+3, reflow=False)
self.emit("goto failed;", depth+3)
self.emit("}", depth+2)
- self.emit("asdl_seq_SET(%s, i, value);" % field.name, depth+2)
+ self.emit("asdl_seq_SET(%s, i, val);" % field.name, depth+2)
self.emit("}", depth+1)
else:
self.emit("res = obj2ast_%s(tmp, &%s, arena);" %