Mercurial > cpython-lru_cache-weakref
diff Python/Python-ast.c @ 46204:29ea507fd998 legacy-trunk
Make _fields attr for no fields consistent with _attributes attr.
| author | Georg Brandl <georg@python.org> |
|---|---|
| date | Sun, 30 Mar 2008 19:00:49 +0000 |
| parents | 42c5d287a852 |
| children | 59d42e6d1885 |
line wrap: on
line diff
--- a/Python/Python-ast.c Sun Mar 30 07:09:22 2008 +0000 +++ b/Python/Python-ast.c Sun Mar 30 19:00:49 2008 +0000 @@ -465,14 +465,9 @@ { 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);
