diff options
Diffstat (limited to 'python/modules/IcePy/BatchRequestInterceptor.cpp')
-rw-r--r-- | python/modules/IcePy/BatchRequestInterceptor.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/python/modules/IcePy/BatchRequestInterceptor.cpp b/python/modules/IcePy/BatchRequestInterceptor.cpp index 83577944689..a39bfa6bd9c 100644 --- a/python/modules/IcePy/BatchRequestInterceptor.cpp +++ b/python/modules/IcePy/BatchRequestInterceptor.cpp @@ -261,8 +261,15 @@ IcePy::BatchRequestInterceptor::enqueue(const Ice::BatchRequest& request, int qu obj->size = 0; obj->operation = 0; obj->proxy = 0; - PyObjectHandle tmp = PyObject_CallMethod(_interceptor.get(), STRCAST("enqueue"), STRCAST("Oii"), obj, queueCount, - queueSize); + PyObjectHandle tmp; + if(PyCallable_Check(_interceptor.get())) + { + tmp = PyObject_CallFunction(_interceptor.get(), STRCAST("Oii"), obj, queueCount, queueSize); + } + else + { + tmp = PyObject_CallMethod(_interceptor.get(), STRCAST("enqueue"), STRCAST("Oii"), obj, queueCount, queueSize); + } Py_DECREF(reinterpret_cast<PyObject*>(obj)); if(!tmp.get()) { |