summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2009-05-09 18:10:51 (GMT)
committerBenjamin Peterson <benjamin@python.org>2009-05-09 18:10:51 (GMT)
commit8bc5b681599b66887f69ca54631d6e1ce4894252 (patch)
tree0faf1412a3f8470e37e1cc7476b5ba573769ae9a
parentc3491d310f1777eacb8faf245c50652a0a36a706 (diff)
downloadcpython-8bc5b681599b66887f69ca54631d6e1ce4894252.zip
cpython-8bc5b681599b66887f69ca54631d6e1ce4894252.tar.gz
cpython-8bc5b681599b66887f69ca54631d6e1ce4894252.tar.bz2
these builtins have to be initialized
-rw-r--r--Include/Python.h1
-rw-r--r--Include/bltinmodule.h14
-rw-r--r--Makefile.pre.in1
-rw-r--r--Objects/object.c9
-rw-r--r--Python/bltinmodule.c6
5 files changed, 25 insertions, 6 deletions
diff --git a/Include/Python.h b/Include/Python.h
index 969ef0f..5c6e1f2 100644
--- a/Include/Python.h
+++ b/Include/Python.h
@@ -113,6 +113,7 @@
#include "import.h"
#include "abstract.h"
+#include "bltinmodule.h"
#include "compile.h"
#include "eval.h"
diff --git a/Include/bltinmodule.h b/Include/bltinmodule.h
new file mode 100644
index 0000000..868c9e6
--- /dev/null
+++ b/Include/bltinmodule.h
@@ -0,0 +1,14 @@
+#ifndef Py_BLTINMODULE_H
+#define Py_BLTINMODULE_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+PyAPI_DATA(PyTypeObject) PyFilter_Type;
+PyAPI_DATA(PyTypeObject) PyMap_Type;
+PyAPI_DATA(PyTypeObject) PyZip_Type;
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* !Py_BLTINMODULE_H */
diff --git a/Makefile.pre.in b/Makefile.pre.in
index 0a4b35e..f46b7ad 100644
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -612,6 +612,7 @@ PYTHON_HEADERS= \
Include/abstract.h \
Include/asdl.h \
Include/ast.h \
+ Include/bltinmodule.h \
Include/bitset.h \
Include/boolobject.h \
Include/bytes_methods.h \
diff --git a/Objects/object.c b/Objects/object.c
index 9544b9a..58b70f0 100644
--- a/Objects/object.c
+++ b/Objects/object.c
@@ -1595,6 +1595,15 @@ _Py_ReadyTypes(void)
if (PyType_Ready(&PyMemberDescr_Type) < 0)
Py_FatalError("Can't initialize member descriptor type");
+
+ if (PyType_Ready(&PyFilter_Type) < 0)
+ Py_FatalError("Can't initialize filter type");
+
+ if (PyType_Ready(&PyMap_Type) < 0)
+ Py_FatalError("Can't initialize map type");
+
+ if (PyType_Ready(&PyZip_Type) < 0)
+ Py_FatalError("Can't initialize zip type");
}
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c
index 7a27fba..c33a37e 100644
--- a/Python/bltinmodule.c
+++ b/Python/bltinmodule.c
@@ -317,8 +317,6 @@ typedef struct {
PyObject *it;
} filterobject;
-PyTypeObject PyFilter_Type;
-
static PyObject *
filter_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
@@ -913,8 +911,6 @@ typedef struct {
PyObject *func;
} mapobject;
-PyTypeObject PyMap_Type;
-
static PyObject *
map_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
@@ -2031,8 +2027,6 @@ typedef struct {
PyObject *result;
} zipobject;
-PyTypeObject PyZip_Type;
-
static PyObject *
zip_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{