comparison Python/sysmodule.c @ 54326:db212869d814

Merged revisions 72907 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r72907 | benjamin.peterson | 2009-05-24 21:40:21 -0500 (Sun, 24 May 2009) | 1 line handle errors from _PyObject_LookupSpecial when __get__ fails ........
author Benjamin Peterson <benjamin@python.org>
date Mon, 25 May 2009 03:10:48 +0000
parents 89631f627810
children 4d38e51e7cdc
comparison
equal deleted inserted replaced
54324:eb0cd83c84ab 54326:db212869d814
650 if (PyType_Ready(Py_TYPE(o)) < 0) 650 if (PyType_Ready(Py_TYPE(o)) < 0)
651 return NULL; 651 return NULL;
652 652
653 method = _PyObject_LookupSpecial(o, "__sizeof__", 653 method = _PyObject_LookupSpecial(o, "__sizeof__",
654 &str__sizeof__); 654 &str__sizeof__);
655 if (method == NULL) 655 if (method == NULL) {
656 PyErr_Format(PyExc_TypeError, 656 if (!PyErr_Occurred())
657 "Type %.100s doesn't define __sizeof__", 657 PyErr_Format(PyExc_TypeError,
658 Py_TYPE(o)->tp_name); 658 "Type %.100s doesn't define __sizeof__",
659 Py_TYPE(o)->tp_name);
660 }
659 else { 661 else {
660 res = PyObject_CallFunctionObjArgs(method, NULL); 662 res = PyObject_CallFunctionObjArgs(method, NULL);
661 Py_DECREF(method); 663 Py_DECREF(method);
662 } 664 }
663 665