summaryrefslogtreecommitdiff
path: root/py/modules/IcePy/Communicator.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'py/modules/IcePy/Communicator.cpp')
-rw-r--r--py/modules/IcePy/Communicator.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/py/modules/IcePy/Communicator.cpp b/py/modules/IcePy/Communicator.cpp
index 23231208a50..6dea0305af6 100644
--- a/py/modules/IcePy/Communicator.cpp
+++ b/py/modules/IcePy/Communicator.cpp
@@ -141,6 +141,7 @@ communicatorInit(CommunicatorObject* self, PyObject* args, PyObject* /*kwds*/)
PyObjectHandle properties = PyObject_GetAttrString(initData, STRCAST("properties"));
PyObjectHandle logger = PyObject_GetAttrString(initData, STRCAST("logger"));
PyObjectHandle threadHook = PyObject_GetAttrString(initData, STRCAST("threadHook"));
+ PyErr_Clear(); // PyObject_GetAttrString sets an error on failure.
if(properties.get() && properties.get() != Py_None)
{
@@ -426,14 +427,7 @@ communicatorIsShutdown(CommunicatorObject* self)
return 0;
}
- if(isShutdown)
- {
- PyRETURN_TRUE;
- }
- else
- {
- PyRETURN_FALSE;
- }
+ PyRETURN_BOOL(isShutdown);
}
#ifdef WIN32