summaryrefslogtreecommitdiff
path: root/Python/Python-ast.c
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2008-03-30 19:00:49 +0000
committerGeorg Brandl <georg@python.org>2008-03-30 19:00:49 +0000
commitb857118d3e617e30af0f24a73408555abaadc2a4 (patch)
tree4968385a6c79f1e63de88c343e4bbbd92c71b815 /Python/Python-ast.c
parent2fa2ae334a91a7e590062a09cc93544f4a42a103 (diff)
downloadcpython-b857118d3e617e30af0f24a73408555abaadc2a4.tar.gz
Make _fields attr for no fields consistent with _attributes attr.
Diffstat (limited to 'Python/Python-ast.c')
-rw-r--r--Python/Python-ast.c11
1 files changed, 3 insertions, 8 deletions
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);