diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2007-07-22 14:41:55 (GMT) |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2007-07-22 14:41:55 (GMT) |
commit | 95c95ce5be8cf87e0e95ef285664aabda7ddd170 (patch) | |
tree | 154ee47a643efbe4c628b196e2e2dce88f61ecf6 /Mac/Modules/res/_Resmodule.c | |
parent | 5d7428b8ce0ffc79b24b05df2b3d2865db037902 (diff) | |
download | cpython-95c95ce5be8cf87e0e95ef285664aabda7ddd170.zip cpython-95c95ce5be8cf87e0e95ef285664aabda7ddd170.tar.gz cpython-95c95ce5be8cf87e0e95ef285664aabda7ddd170.tar.bz2 |
Merged revisions 56483-56491 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/p3yk
........
r56486 | kurt.kaiser | 2007-07-22 05:27:08 +0200 (So, 22 Jul 2007) | 2 lines
Fix typo introduced at r55797
........
r56487 | kurt.kaiser | 2007-07-22 07:48:45 +0200 (So, 22 Jul 2007) | 2 lines
Exception attr accessed via args in py3k.
........
r56489 | martin.v.loewis | 2007-07-22 15:32:44 +0200 (So, 22 Jul 2007) | 2 lines
Regenerate.
........
r56490 | martin.v.loewis | 2007-07-22 15:34:06 +0200 (So, 22 Jul 2007) | 2 lines
Port Mac modules to PEP 3123.
........
r56491 | martin.v.loewis | 2007-07-22 16:35:53 +0200 (So, 22 Jul 2007) | 1 line
Port to PEP 3123.
........
Diffstat (limited to 'Mac/Modules/res/_Resmodule.c')
-rw-r--r-- | Mac/Modules/res/_Resmodule.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/Mac/Modules/res/_Resmodule.c b/Mac/Modules/res/_Resmodule.c index 9069e9c..1cc38ef 100644 --- a/Mac/Modules/res/_Resmodule.c +++ b/Mac/Modules/res/_Resmodule.c @@ -41,7 +41,7 @@ static PyObject *Res_Error; PyTypeObject Resource_Type; -#define ResObj_Check(x) ((x)->ob_type == &Resource_Type || PyObject_TypeCheck((x), &Resource_Type)) +#define ResObj_Check(x) (Py_Type(x) == &Resource_Type || PyObject_TypeCheck((x), &Resource_Type)) typedef struct ResourceObject { PyObject_HEAD @@ -89,7 +89,7 @@ static void ResObj_dealloc(ResourceObject *self) self->ob_freeit(self->ob_itself); } self->ob_itself = NULL; - self->ob_type->tp_free((PyObject *)self); + Py_Type(self)->tp_free((PyObject *)self); } static PyObject *ResObj_HomeResFile(ResourceObject *_self, PyObject *_args) @@ -617,8 +617,7 @@ static PyObject *ResObj_tp_new(PyTypeObject *type, PyObject *_args, PyObject *_k PyTypeObject Resource_Type = { - PyObject_HEAD_INIT(NULL) - 0, /*ob_size*/ + PyVarObject_HEAD_INIT(NULL, 0) "_Res.Resource", /*tp_name*/ sizeof(ResourceObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ @@ -1731,7 +1730,7 @@ void init_Res(void) if (Res_Error == NULL || PyDict_SetItemString(d, "Error", Res_Error) != 0) return; - Resource_Type.ob_type = &PyType_Type; + Py_Type(&Resource_Type) = &PyType_Type; if (PyType_Ready(&Resource_Type) < 0) return; Py_INCREF(&Resource_Type); PyModule_AddObject(m, "Resource", (PyObject *)&Resource_Type); |