summaryrefslogtreecommitdiffstats
path: root/Python/import.c
diff options
context:
space:
mode:
authorBrett Cannon <brett@python.org>2012-05-04 20:13:30 (GMT)
committerBrett Cannon <brett@python.org>2012-05-04 20:13:30 (GMT)
commit0429e1a57da91632010888bb360bb0789fbb8a66 (patch)
tree05283d187f82e4c565fa0d27a66a4d155306886e /Python/import.c
parent2d3ce9de4fd45e9bfa922011078b1e1986022df7 (diff)
downloadcpython-0429e1a57da91632010888bb360bb0789fbb8a66.zip
cpython-0429e1a57da91632010888bb360bb0789fbb8a66.tar.gz
cpython-0429e1a57da91632010888bb360bb0789fbb8a66.tar.bz2
Issue #13959: Move module type constants to Lib/imp.py.
Diffstat (limited to 'Python/import.c')
-rw-r--r--Python/import.c22
1 files changed, 0 insertions, 22 deletions
diff --git a/Python/import.c b/Python/import.c
index 4edc3a7..4f8229b 100644
--- a/Python/import.c
+++ b/Python/import.c
@@ -2091,17 +2091,6 @@ static PyMethodDef imp_methods[] = {
{NULL, NULL} /* sentinel */
};
-static int
-setint(PyObject *d, char *name, int value)
-{
- PyObject *v;
- int err;
-
- v = PyLong_FromLong((long)value);
- err = PyDict_SetItemString(d, name, v);
- Py_XDECREF(v);
- return err;
-}
static struct PyModuleDef impmodule = {
PyModuleDef_HEAD_INIT,
@@ -2127,17 +2116,6 @@ PyInit_imp(void)
if (d == NULL)
goto failure;
- if (setint(d, "SEARCH_ERROR", SEARCH_ERROR) < 0) goto failure;
- if (setint(d, "PY_SOURCE", PY_SOURCE) < 0) goto failure;
- if (setint(d, "PY_COMPILED", PY_COMPILED) < 0) goto failure;
- if (setint(d, "C_EXTENSION", C_EXTENSION) < 0) goto failure;
- if (setint(d, "PY_RESOURCE", PY_RESOURCE) < 0) goto failure;
- if (setint(d, "PKG_DIRECTORY", PKG_DIRECTORY) < 0) goto failure;
- if (setint(d, "C_BUILTIN", C_BUILTIN) < 0) goto failure;
- if (setint(d, "PY_FROZEN", PY_FROZEN) < 0) goto failure;
- if (setint(d, "PY_CODERESOURCE", PY_CODERESOURCE) < 0) goto failure;
- if (setint(d, "IMP_HOOK", IMP_HOOK) < 0) goto failure;
-
return m;
failure:
Py_XDECREF(m);