[Zope-CVS] CVS: Packages/ContextWrapper - wrapper.c:1.7
Fred Drake Jr
fdrake@acm.org
Wed, 14 Nov 2001 15:23:43 -0500
Update of /cvs-repository/Packages/ContextWrapper
In directory cvs.zope.org:/tmp/cvs-serv20928
Modified Files:
wrapper.c
Log Message:
Make sure the C API sets exceptions when unexpected NULLs are passed in.
=== Packages/ContextWrapper/wrapper.c 1.6 => 1.7 ===
{
if (obj == NULL)
- return NULL;
+ return missing_wrapper("getinnerobject");
while (Wrapper_Check(obj)) {
obj = ((WrapperObject *)obj)->wrap_object;
}
@@ -216,7 +216,7 @@
api_getcontext(PyObject *wrapper)
{
if (wrapper == NULL)
- return NULL;
+ return missing_wrapper("getcontext");
if (Wrapper_Check(wrapper))
return ((WrapperObject *)wrapper)->wrap_context;
else
@@ -227,7 +227,7 @@
api_getinnercontext(PyObject *obj)
{
if (obj == NULL)
- return NULL;
+ return missing_wrapper("getinnercontext");
if (Wrapper_Check(obj)) {
WrapperObject *wrapper = (WrapperObject *)obj;
obj = wrapper->wrap_object;
@@ -245,7 +245,7 @@
api_getdict(PyObject *wrapper)
{
if (wrapper == NULL)
- return NULL;
+ return missing_wrapper("getdict");
if (Wrapper_Check(wrapper))
return ((WrapperObject *)wrapper)->wrap_dict;
else
@@ -274,7 +274,7 @@
PyObject *oldobject;
if (wrapper == NULL || object == NULL) {
PyErr_SetString(PyExc_RuntimeError,
- "cannot pass NULL to WrapperAPI.setobject()");
+ "cannot pass NULL to setobject()");
return 0;
}
if (!check_wrapper(wrapper, "setobject"))