these builtins have to be initialized
authorBenjamin Peterson <benjamin@python.org>
Sat, 9 May 2009 18:10:51 +0000 (18:10 +0000)
committerBenjamin Peterson <benjamin@python.org>
Sat, 9 May 2009 18:10:51 +0000 (18:10 +0000)
Include/Python.h
Include/bltinmodule.h [new file with mode: 0644]
Makefile.pre.in
Objects/object.c
Python/bltinmodule.c

index 969ef0f191276b111974d60d481c7d3585545583..5c6e1f2c2259ed8b8bdb5dbcc9f9dda545bd863a 100644 (file)
 #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 (file)
index 0000000..868c9e6
--- /dev/null
@@ -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 */
index 0a4b35ec28411f147d687b2cb46f9be496cb4083..f46b7ad47f7bdde659a8a0fb7b10ddad8035d263 100644 (file)
@@ -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 \
index 9544b9ac08779e8d71aa7a9f94bfd95bfa34f5a6..58b70f09e74041251038dde3248129b73391ccbc 100644 (file)
@@ -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");
 }
 
 
index 7a27fba42ec997c5329ed536c77c04d5c5d7d1e8..c33a37ea13be8fa0353867d7c62b56cf29ff583d 100644 (file)
@@ -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)
 {