summaryrefslogtreecommitdiffstats
path: root/Parser/asdl_c.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2008-03-30 19:00:49 (GMT)
committerGeorg Brandl <georg@python.org>2008-03-30 19:00:49 (GMT)
commit2c55c597faf023a0b74aa48f911493c010f464c5 (patch)
tree8f305d3e6c0249eaac509b797ce8956357c9127a /Parser/asdl_c.py
parentebc8dedd1996db68c889c2cdf2701fd7eadc501f (diff)
downloadcpython-2c55c597faf023a0b74aa48f911493c010f464c5.zip
cpython-2c55c597faf023a0b74aa48f911493c010f464c5.tar.gz
cpython-2c55c597faf023a0b74aa48f911493c010f464c5.tar.bz2
Make _fields attr for no fields consistent with _attributes attr.
Diffstat (limited to 'Parser/asdl_c.py')
-rwxr-xr-xParser/asdl_c.py11
1 files changed, 3 insertions, 8 deletions
diff --git a/Parser/asdl_c.py b/Parser/asdl_c.py
index 91196df..08592bc 100755
--- a/Parser/asdl_c.py
+++ b/Parser/asdl_c.py
@@ -674,14 +674,9 @@ static PyTypeObject* make_type(char *type, PyTypeObject* base, char**fields, int
{
PyObject *fnames, *result;
int i;
- if (num_fields) {
- fnames = PyTuple_New(num_fields);
- if (!fnames) return NULL;
- } else {
- fnames = Py_None;
- Py_INCREF(Py_None);
- }
- for(i=0; i < num_fields; i++) {
+ fnames = PyTuple_New(num_fields);
+ if (!fnames) return NULL;
+ for (i = 0; i < num_fields; i++) {
PyObject *field = PyString_FromString(fields[i]);
if (!field) {
Py_DECREF(fnames);