diff options
author | Benjamin Peterson <benjamin@python.org> | 2011-07-22 22:20:58 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2011-07-22 22:20:58 (GMT) |
commit | 5eed3062f5e80eced5c3601004466786f4ace70a (patch) | |
tree | fcd03d81731b032b78a4db77130fa1948c6cc4e3 /Python/Python-ast.c | |
parent | 6c18ff0808029fd91dd4bfb6f216c1bb59452526 (diff) | |
download | cpython-5eed3062f5e80eced5c3601004466786f4ace70a.zip cpython-5eed3062f5e80eced5c3601004466786f4ace70a.tar.gz cpython-5eed3062f5e80eced5c3601004466786f4ace70a.tar.bz2 |
allow None identifiers
Diffstat (limited to 'Python/Python-ast.c')
-rw-r--r-- | Python/Python-ast.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Python/Python-ast.c b/Python/Python-ast.c index 91ad3ad..dcfde3c 100644 --- a/Python/Python-ast.c +++ b/Python/Python-ast.c @@ -2,7 +2,7 @@ /* - __version__ . + __version__ 82160. This module must be committed separately after each AST grammar change; The __version__ number is set to the revision number of the commit @@ -596,7 +596,7 @@ static int obj2ast_object(PyObject* obj, PyObject** out, PyArena* arena) static int obj2ast_identifier(PyObject* obj, PyObject** out, PyArena* arena) { - if (!PyString_CheckExact(obj)) { + if (!PyString_CheckExact(obj) && obj != Py_None) { PyErr_Format(PyExc_TypeError, "AST identifier must be of type str"); return 1; @@ -6587,7 +6587,7 @@ init_ast(void) if (PyDict_SetItemString(d, "AST", (PyObject*)&AST_type) < 0) return; if (PyModule_AddIntConstant(m, "PyCF_ONLY_AST", PyCF_ONLY_AST) < 0) return; - if (PyModule_AddStringConstant(m, "__version__", "") < 0) + if (PyModule_AddStringConstant(m, "__version__", "82160") < 0) return; if (PyDict_SetItemString(d, "mod", (PyObject*)mod_type) < 0) return; if (PyDict_SetItemString(d, "Module", (PyObject*)Module_type) < 0) |