summaryrefslogtreecommitdiff
path: root/py/modules/IcePy/ObjectFactory.cpp
diff options
context:
space:
mode:
authorMark Spruiell <mes@zeroc.com>2009-02-12 11:42:01 -0800
committerMark Spruiell <mes@zeroc.com>2009-02-12 11:42:01 -0800
commit215dbf06a885c6754572279b38d2ac4e823a57ba (patch)
tree1af98a5457c070bc0a233039504a6c97fcd2222a /py/modules/IcePy/ObjectFactory.cpp
parentminor tweaks to various README/INSTALL files (diff)
downloadice-215dbf06a885c6754572279b38d2ac4e823a57ba.tar.bz2
ice-215dbf06a885c6754572279b38d2ac4e823a57ba.tar.xz
ice-215dbf06a885c6754572279b38d2ac4e823a57ba.zip
bug 3356 - review use of AbortMarshaling in Python extension
Diffstat (limited to 'py/modules/IcePy/ObjectFactory.cpp')
-rw-r--r--py/modules/IcePy/ObjectFactory.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/py/modules/IcePy/ObjectFactory.cpp b/py/modules/IcePy/ObjectFactory.cpp
index cfc87158368..badf7716ae1 100644
--- a/py/modules/IcePy/ObjectFactory.cpp
+++ b/py/modules/IcePy/ObjectFactory.cpp
@@ -62,6 +62,7 @@ IcePy::ObjectFactory::create(const string& id)
PyObjectHandle obj = PyObject_CallMethod(factory, STRCAST("create"), STRCAST("s"), id.c_str());
if(!obj.get())
{
+ assert(PyErr_Occurred());
throw AbortMarshaling();
}
if(obj.get() == Py_None)
@@ -87,6 +88,7 @@ IcePy::ObjectFactory::create(const string& id)
PyObjectHandle obj = type->tp_new(type, args.get(), 0);
if(!obj.get())
{
+ assert(PyErr_Occurred());
throw AbortMarshaling();
}
@@ -116,7 +118,7 @@ IcePy::ObjectFactory::destroy()
// Invoke the destroy method on each registered Python factory.
//
PyObjectHandle obj = PyObject_CallMethod(p->second, STRCAST("destroy"), 0);
- PyErr_Clear();
+ PyErr_Clear(); // Ignore errors.
Py_DECREF(p->second);
}
}