[Zope-Checkins] CVS: Zope2 - cAccessControl.c:1.9
shane@digicool.com
shane@digicool.com
Wed, 11 Jul 2001 16:49:13 -0400 (EDT)
Update of /cvs-repository/Zope2/lib/python/AccessControl
In directory korak.digicool.com:/tmp/cvs-serv16169
Modified Files:
cAccessControl.c
Log Message:
Added PyErr_Clear() to some places that need it.
--- Updated File cAccessControl.c in package Zope2 --
--- cAccessControl.c 2001/07/03 19:37:52 1.8
+++ cAccessControl.c 2001/07/11 20:49:13 1.9
@@ -436,12 +436,18 @@
if (_name == NULL) {
PyErr_Clear();
_name = PyObject_GetAttrString(value,"__name__");
+ if (_name == NULL) {
+ PyErr_Clear();
+ }
}
if (_name != NULL && PyCallable_Check(_name)) {
_name1 = PyObject_CallObject(_name, NULL);
Py_DECREF(_name);
_name = _name1;
+ if (_name == NULL) {
+ PyErr_Clear();
+ }
}
}
if (_name == NULL) {
@@ -450,7 +456,10 @@
}
_name1 = PyObject_Str(_name);
- if (_name1 == NULL) s = "None";
+ if (_name1 == NULL) {
+ PyErr_Clear();
+ s = "? (non-printable object)";
+ }
else s = PyString_AsString(_name1);
snprintf(msgbuff,sizeof(msgbuff)-1,
@@ -1484,6 +1493,8 @@
}
}
}
+ else
+ PyErr_Clear();
/*| obj = getattr(obj, 'aq_inner', None)
**| if obj is None: break