these builtins have to be initialized

This commit is contained in:
Benjamin Peterson 2009-05-09 18:10:51 +00:00
parent c3491d310f
commit 8bc5b68159
5 changed files with 25 additions and 6 deletions

View File

@ -113,6 +113,7 @@
#include "import.h" #include "import.h"
#include "abstract.h" #include "abstract.h"
#include "bltinmodule.h"
#include "compile.h" #include "compile.h"
#include "eval.h" #include "eval.h"

14
Include/bltinmodule.h Normal file
View File

@ -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 */

View File

@ -612,6 +612,7 @@ PYTHON_HEADERS= \
Include/abstract.h \ Include/abstract.h \
Include/asdl.h \ Include/asdl.h \
Include/ast.h \ Include/ast.h \
Include/bltinmodule.h \
Include/bitset.h \ Include/bitset.h \
Include/boolobject.h \ Include/boolobject.h \
Include/bytes_methods.h \ Include/bytes_methods.h \

View File

@ -1595,6 +1595,15 @@ _Py_ReadyTypes(void)
if (PyType_Ready(&PyMemberDescr_Type) < 0) if (PyType_Ready(&PyMemberDescr_Type) < 0)
Py_FatalError("Can't initialize member descriptor type"); 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");
} }

View File

@ -317,8 +317,6 @@ typedef struct {
PyObject *it; PyObject *it;
} filterobject; } filterobject;
PyTypeObject PyFilter_Type;
static PyObject * static PyObject *
filter_new(PyTypeObject *type, PyObject *args, PyObject *kwds) filter_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{ {
@ -913,8 +911,6 @@ typedef struct {
PyObject *func; PyObject *func;
} mapobject; } mapobject;
PyTypeObject PyMap_Type;
static PyObject * static PyObject *
map_new(PyTypeObject *type, PyObject *args, PyObject *kwds) map_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{ {
@ -2031,8 +2027,6 @@ typedef struct {
PyObject *result; PyObject *result;
} zipobject; } zipobject;
PyTypeObject PyZip_Type;
static PyObject * static PyObject *
zip_new(PyTypeObject *type, PyObject *args, PyObject *kwds) zip_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{ {