mirror of
https://github.com/python/cpython.git
synced 2025-08-25 03:04:55 +00:00
from __future__ import with_statement addon for 'with', mostly written by
Neal.
This commit is contained in:
parent
edc8f1366a
commit
34aa7ba114
16 changed files with 102 additions and 40 deletions
|
@ -371,7 +371,7 @@ static PyTypeObject* make_type(char *type, PyTypeObject* base, char**fields, int
|
|||
}
|
||||
PyTuple_SET_ITEM(fnames, i, field);
|
||||
}
|
||||
result = PyObject_CallFunction((PyObject*)&PyType_Type, "s(O){sOss}",
|
||||
result = PyObject_CallFunction((PyObject*)&PyType_Type, "s(O){sOss}",
|
||||
type, base, "_fields", fnames, "__module__", "_ast");
|
||||
Py_DECREF(fnames);
|
||||
return (PyTypeObject*)result;
|
||||
|
@ -2956,7 +2956,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__", "42635") < 0)
|
||||
if (PyModule_AddStringConstant(m, "__version__", "42649") < 0)
|
||||
return;
|
||||
if(PyDict_SetItemString(d, "mod", (PyObject*)mod_type) < 0) return;
|
||||
if(PyDict_SetItemString(d, "Module", (PyObject*)Module_type) < 0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue