summaryrefslogtreecommitdiff
path: root/qpid/cpp/include
diff options
context:
space:
mode:
Diffstat (limited to 'qpid/cpp/include')
-rw-r--r--qpid/cpp/include/qpid/swig_python_typemaps.i19
1 files changed, 11 insertions, 8 deletions
diff --git a/qpid/cpp/include/qpid/swig_python_typemaps.i b/qpid/cpp/include/qpid/swig_python_typemaps.i
index e9a84ffa8e..0fc4d9019f 100644
--- a/qpid/cpp/include/qpid/swig_python_typemaps.i
+++ b/qpid/cpp/include/qpid/swig_python_typemaps.i
@@ -30,13 +30,16 @@ static PyObject* pUuidModule;
* qpid.datatypes.
*/
pUuidModule = PyImport_ImportModule("qpid.datatypes");
-
- /* Although it is not required, we'll publish the uuid module in our
- * module, as if this module was a python module and we called
- * "import uuid"
- */
- Py_INCREF(pUuidModule);
- PyModule_AddObject(m, "uuid", pUuidModule);
+ if (pUuidModule) {
+ /* Although it is not required, we'll publish the uuid module in our
+ * module, as if this module was a python module and we called
+ * "import uuid"
+ */
+ Py_INCREF(pUuidModule);
+ PyModule_AddObject(m, "uuid", pUuidModule);
+ } else {
+ if (!PyErr_Occurred) PyErr_SetString(PyExc_ImportError, "Cannot import qpid.datatypes");
+ }
%}
@@ -101,7 +104,7 @@ typedef int Py_ssize_t;
result = PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) v->asUint64());
break;
}
- case qpid::types::VAR_INT8 :
+ case qpid::types::VAR_INT8 :
case qpid::types::VAR_INT16 :
case qpid::types::VAR_INT32 : {
result = PyInt_FromLong((long) v->asInt32());