From 2c55c597faf023a0b74aa48f911493c010f464c5 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Sun, 30 Mar 2008 19:00:49 +0000 Subject: Make _fields attr for no fields consistent with _attributes attr. --- Python/Python-ast.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'Python/Python-ast.c') diff --git a/Python/Python-ast.c b/Python/Python-ast.c index c44ce383c6..d4734187de 100644 --- a/Python/Python-ast.c +++ b/Python/Python-ast.c @@ -465,14 +465,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); -- cgit v1.2.1