summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2001-08-24 06:29:12 (GMT)
committerTim Peters <tim.peters@gmail.com>2001-08-24 06:29:12 (GMT)
commit89675078cb2a37e557e66874ded3b8ff95b85771 (patch)
treeaaa10385896666a9e2feba05b2eee0ede440f2f9 /Modules
parent4e2fbce71cf1dbb7b94dc7d4f781cb82c7e9efe7 (diff)
downloadcpython-89675078cb2a37e557e66874ded3b8ff95b85771.zip
cpython-89675078cb2a37e557e66874ded3b8ff95b85771.tar.gz
cpython-89675078cb2a37e557e66874ded3b8ff95b85771.tar.bz2
Back out trying to use the C values for CO_xxx.
__future__.py reverted to 1.9. newmodule.c reverted to 2.32.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/newmodule.c33
1 files changed, 2 insertions, 31 deletions
diff --git a/Modules/newmodule.c b/Modules/newmodule.c
index d1869e5..7b91fb8 100644
--- a/Modules/newmodule.c
+++ b/Modules/newmodule.c
@@ -220,38 +220,9 @@ char new_doc[] =
\n\
You need to know a great deal about the interpreter to use this!";
-static void
-insertint(PyObject *d, char *name, int value)
-{
- PyObject *v = PyInt_FromLong((long) value);
- if (v == NULL) {
- /* Don't bother reporting this error */
- PyErr_Clear();
- }
- else {
- PyDict_SetItemString(d, name, v);
- Py_DECREF(v);
- }
-}
-
DL_EXPORT(void)
initnew(void)
{
- PyObject *m;
- PyObject *d;
-
- m = Py_InitModule4("new", new_methods, new_doc, (PyObject *)NULL,
- PYTHON_API_VERSION);
- d = PyModule_GetDict(m);
-
-#define ADDSYM(TOKEN) insertint(d, #TOKEN, TOKEN)
- ADDSYM(CO_OPTIMIZED);
- ADDSYM(CO_NEWLOCALS);
- ADDSYM(CO_VARARGS);
- ADDSYM(CO_VARKEYWORDS);
- ADDSYM(CO_NESTED);
- ADDSYM(CO_GENERATOR);
- ADDSYM(CO_GENERATOR_ALLOWED);
- ADDSYM(CO_FUTURE_DIVISION);
-#undef ADDSYM
+ Py_InitModule4("new", new_methods, new_doc, (PyObject *)NULL,
+ PYTHON_API_VERSION);
}