Skip to content

Commit fd838e6

Browse files
committed
Merged revisions 71734,71738-71739 via svnmerge from
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 ........
1 parent ea835e7 commit fd838e6

File tree

4 files changed

+48
-7
lines changed

4 files changed

+48
-7
lines changed

Include/descrobject.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ PyAPI_DATA(PyTypeObject) PyMemberDescr_Type;
7373
PyAPI_DATA(PyTypeObject) PyMethodDescr_Type;
7474
PyAPI_DATA(PyTypeObject) PyWrapperDescr_Type;
7575
PyAPI_DATA(PyTypeObject) PyDictProxy_Type;
76+
PyAPI_DATA(PyTypeObject) PyGetSetDescr_Type;
77+
PyAPI_DATA(PyTypeObject) PyMemberDescr_Type;
7678

7779
PyAPI_FUNC(PyObject *) PyDescr_NewMethod(PyTypeObject *, PyMethodDef *);
7880
PyAPI_FUNC(PyObject *) PyDescr_NewClassMethod(PyTypeObject *, PyMethodDef *);

Include/sliceobject.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ typedef struct {
2525
} PySliceObject;
2626

2727
PyAPI_DATA(PyTypeObject) PySlice_Type;
28+
PyAPI_DATA(PyTypeObject) PyEllipsis_Type;
2829

2930
#define PySlice_Check(op) (Py_TYPE(op) == &PySlice_Type)
3031

Objects/object.c

Lines changed: 44 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
#include "Python.h"
55
#include "sliceobject.h" /* For PyEllipsis_Type */
6+
#include "frameobject.h"
67

78
#ifdef __cplusplus
89
extern "C" {
@@ -1484,17 +1485,23 @@ _Py_ReadyTypes(void)
14841485
if (PyType_Ready(&_PyWeakref_RefType) < 0)
14851486
Py_FatalError("Can't initialize weakref type");
14861487

1488+
if (PyType_Ready(&_PyWeakref_CallableProxyType) < 0)
1489+
Py_FatalError("Can't initialize callable weakref proxy type");
1490+
1491+
if (PyType_Ready(&_PyWeakref_ProxyType) < 0)
1492+
Py_FatalError("Can't initialize weakref proxy type");
1493+
14871494
if (PyType_Ready(&PyBool_Type) < 0)
14881495
Py_FatalError("Can't initialize bool type");
14891496

14901497
if (PyType_Ready(&PyByteArray_Type) < 0)
1491-
Py_FatalError("Can't initialize bytearray");
1498+
Py_FatalError("Can't initialize bytearray type");
14921499

14931500
if (PyType_Ready(&PyBytes_Type) < 0)
14941501
Py_FatalError("Can't initialize 'str'");
14951502

14961503
if (PyType_Ready(&PyList_Type) < 0)
1497-
Py_FatalError("Can't initialize list");
1504+
Py_FatalError("Can't initialize list type");
14981505

14991506
if (PyType_Ready(&PyNone_Type) < 0)
15001507
Py_FatalError("Can't initialize None type");
@@ -1532,9 +1539,10 @@ _Py_ReadyTypes(void)
15321539
if (PyType_Ready(&PyStaticMethod_Type) < 0)
15331540
Py_FatalError("Can't initialize static method type");
15341541

1542+
#ifndef WITHOUT_COMPLEX
15351543
if (PyType_Ready(&PyComplex_Type) < 0)
15361544
Py_FatalError("Can't initialize complex type");
1537-
1545+
#endif
15381546
if (PyType_Ready(&PyFloat_Type) < 0)
15391547
Py_FatalError("Can't initialize float type");
15401548

@@ -1559,11 +1567,41 @@ _Py_ReadyTypes(void)
15591567
if (PyType_Ready(&PyReversed_Type) < 0)
15601568
Py_FatalError("Can't initialize reversed type");
15611569

1562-
if (PyType_Ready(&PyCode_Type) < 0)
1563-
Py_FatalError("Can't initialize 'code'");
1564-
15651570
if (PyType_Ready(&PyStdPrinter_Type) < 0)
15661571
Py_FatalError("Can't initialize StdPrinter");
1572+
1573+
if (PyType_Ready(&PyCode_Type) < 0)
1574+
Py_FatalError("Can't initialize code type");
1575+
1576+
if (PyType_Ready(&PyFrame_Type) < 0)
1577+
Py_FatalError("Can't initialize frame type");
1578+
1579+
if (PyType_Ready(&PyCFunction_Type) < 0)
1580+
Py_FatalError("Can't initialize builtin function type");
1581+
1582+
if (PyType_Ready(&PyMethod_Type) < 0)
1583+
Py_FatalError("Can't initialize method type");
1584+
1585+
if (PyType_Ready(&PyFunction_Type) < 0)
1586+
Py_FatalError("Can't initialize function type");
1587+
1588+
if (PyType_Ready(&PyDictProxy_Type) < 0)
1589+
Py_FatalError("Can't initialize dict proxy type");
1590+
1591+
if (PyType_Ready(&PyGen_Type) < 0)
1592+
Py_FatalError("Can't initialize generator type");
1593+
1594+
if (PyType_Ready(&PyGetSetDescr_Type) < 0)
1595+
Py_FatalError("Can't initialize get-set descriptor type");
1596+
1597+
if (PyType_Ready(&PyWrapperDescr_Type) < 0)
1598+
Py_FatalError("Can't initialize wrapper type");
1599+
1600+
if (PyType_Ready(&PyEllipsis_Type) < 0)
1601+
Py_FatalError("Can't initialize ellipsis type");
1602+
1603+
if (PyType_Ready(&PyMemberDescr_Type) < 0)
1604+
Py_FatalError("Can't initialize member descriptor type");
15671605
}
15681606

15691607

Objects/sliceobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ ellipsis_repr(PyObject *op)
2222
return PyUnicode_FromString("Ellipsis");
2323
}
2424

25-
static PyTypeObject PyEllipsis_Type = {
25+
PyTypeObject PyEllipsis_Type = {
2626
PyVarObject_HEAD_INIT(&PyType_Type, 0)
2727
"ellipsis", /* tp_name */
2828
0, /* tp_basicsize */

0 commit comments

Comments
 (0)