]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Merged revisions 71734,71738-71739 via svnmerge from
authorBenjamin Peterson <benjamin@python.org>
Mon, 20 Apr 2009 02:09:13 +0000 (02:09 +0000)
committerBenjamin Peterson <benjamin@python.org>
Mon, 20 Apr 2009 02:09:13 +0000 (02:09 +0000)
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r71734 | benjamin.peterson | 2009-04-18 17:15:26 -0500 (Sat, 18 Apr 2009) | 1 line

  many more types to initialize (I had to expose some of them)
........
  r71738 | benjamin.peterson | 2009-04-18 21:32:42 -0500 (Sat, 18 Apr 2009) | 1 line

  initialize weakref some weakref types
........
  r71739 | benjamin.peterson | 2009-04-18 21:40:43 -0500 (Sat, 18 Apr 2009) | 1 line

  make errors consistent
........

Include/descrobject.h
Include/sliceobject.h
Objects/object.c
Objects/sliceobject.c

index f06b42190d99ed61af0daefc8d028000261eea2b..15041ffe187aa3ba2513cf5f4383fe0b335ce1c1 100644 (file)
@@ -73,6 +73,8 @@ PyAPI_DATA(PyTypeObject) PyMemberDescr_Type;
 PyAPI_DATA(PyTypeObject) PyMethodDescr_Type;
 PyAPI_DATA(PyTypeObject) PyWrapperDescr_Type;
 PyAPI_DATA(PyTypeObject) PyDictProxy_Type;
+PyAPI_DATA(PyTypeObject) PyGetSetDescr_Type;
+PyAPI_DATA(PyTypeObject) PyMemberDescr_Type;
 
 PyAPI_FUNC(PyObject *) PyDescr_NewMethod(PyTypeObject *, PyMethodDef *);
 PyAPI_FUNC(PyObject *) PyDescr_NewClassMethod(PyTypeObject *, PyMethodDef *);
index dfc30c705f6d5ede14c8115d3d7db91e35d5e70e..8ab62dd4f8f37276ddf46b5672a544636a1e7614 100644 (file)
@@ -25,6 +25,7 @@ typedef struct {
 } PySliceObject;
 
 PyAPI_DATA(PyTypeObject) PySlice_Type;
+PyAPI_DATA(PyTypeObject) PyEllipsis_Type;
 
 #define PySlice_Check(op) (Py_TYPE(op) == &PySlice_Type)
 
index 1975f141ee77b5c1c61c747e9e4b45bfd8d060d8..bf347b9a63fb2b971b897945b40d90459fdbb641 100644 (file)
@@ -3,6 +3,7 @@
 
 #include "Python.h"
 #include "sliceobject.h" /* For PyEllipsis_Type */
+#include "frameobject.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -1484,17 +1485,23 @@ _Py_ReadyTypes(void)
        if (PyType_Ready(&_PyWeakref_RefType) < 0)
                Py_FatalError("Can't initialize weakref type");
 
+       if (PyType_Ready(&_PyWeakref_CallableProxyType) < 0)
+               Py_FatalError("Can't initialize callable weakref proxy type");
+
+       if (PyType_Ready(&_PyWeakref_ProxyType) < 0)
+               Py_FatalError("Can't initialize weakref proxy type");
+
        if (PyType_Ready(&PyBool_Type) < 0)
                Py_FatalError("Can't initialize bool type");
 
        if (PyType_Ready(&PyByteArray_Type) < 0)
-               Py_FatalError("Can't initialize bytearray");
+               Py_FatalError("Can't initialize bytearray type");
 
        if (PyType_Ready(&PyBytes_Type) < 0)
                Py_FatalError("Can't initialize 'str'");
 
        if (PyType_Ready(&PyList_Type) < 0)
-               Py_FatalError("Can't initialize list");
+               Py_FatalError("Can't initialize list type");
 
        if (PyType_Ready(&PyNone_Type) < 0)
                Py_FatalError("Can't initialize None type");
@@ -1532,9 +1539,10 @@ _Py_ReadyTypes(void)
        if (PyType_Ready(&PyStaticMethod_Type) < 0)
                Py_FatalError("Can't initialize static method type");
 
+#ifndef WITHOUT_COMPLEX
        if (PyType_Ready(&PyComplex_Type) < 0)
                Py_FatalError("Can't initialize complex type");
-
+#endif
        if (PyType_Ready(&PyFloat_Type) < 0)
                Py_FatalError("Can't initialize float type");
 
@@ -1559,11 +1567,41 @@ _Py_ReadyTypes(void)
        if (PyType_Ready(&PyReversed_Type) < 0)
                Py_FatalError("Can't initialize reversed type");
 
-       if (PyType_Ready(&PyCode_Type) < 0)
-               Py_FatalError("Can't initialize 'code'");
-
        if (PyType_Ready(&PyStdPrinter_Type) < 0)
                Py_FatalError("Can't initialize StdPrinter");
+
+       if (PyType_Ready(&PyCode_Type) < 0)
+               Py_FatalError("Can't initialize code type");
+
+       if (PyType_Ready(&PyFrame_Type) < 0)
+               Py_FatalError("Can't initialize frame type");
+
+       if (PyType_Ready(&PyCFunction_Type) < 0)
+               Py_FatalError("Can't initialize builtin function type");
+
+       if (PyType_Ready(&PyMethod_Type) < 0)
+               Py_FatalError("Can't initialize method type");
+
+       if (PyType_Ready(&PyFunction_Type) < 0)
+               Py_FatalError("Can't initialize function type");
+
+       if (PyType_Ready(&PyDictProxy_Type) < 0)
+               Py_FatalError("Can't initialize dict proxy type");
+
+       if (PyType_Ready(&PyGen_Type) < 0)
+               Py_FatalError("Can't initialize generator type");
+
+       if (PyType_Ready(&PyGetSetDescr_Type) < 0)
+               Py_FatalError("Can't initialize get-set descriptor type");
+
+       if (PyType_Ready(&PyWrapperDescr_Type) < 0)
+               Py_FatalError("Can't initialize wrapper type");
+
+       if (PyType_Ready(&PyEllipsis_Type) < 0)
+               Py_FatalError("Can't initialize ellipsis type");
+
+       if (PyType_Ready(&PyMemberDescr_Type) < 0)
+               Py_FatalError("Can't initialize member descriptor type");
 }
 
 
index ed3f520aa93a89ba945e9e31be1039e9663f5cd0..9acd7f77633f388ca12743a2ef956ef364a74ade 100644 (file)
@@ -22,7 +22,7 @@ ellipsis_repr(PyObject *op)
        return PyUnicode_FromString("Ellipsis");
 }
 
-static PyTypeObject PyEllipsis_Type = {
+PyTypeObject PyEllipsis_Type = {
        PyVarObject_HEAD_INIT(&PyType_Type, 0)
        "ellipsis",                     /* tp_name */
        0,                              /* tp_basicsize */