summaryrefslogtreecommitdiff
path: root/python/modules/IcePy/BatchRequestInterceptor.cpp
diff options
context:
space:
mode:
authorMark Spruiell <mes@zeroc.com>2017-03-08 15:47:34 -0800
committerMark Spruiell <mes@zeroc.com>2017-03-08 15:47:34 -0800
commitfc32c2a7805365e7f40ab8a664f94efae35137da (patch)
tree9004df864027bfef52218772e88357e01d9bdf0c /python/modules/IcePy/BatchRequestInterceptor.cpp
parentRefreshed Ice::optional (diff)
downloadice-fc32c2a7805365e7f40ab8a664f94efae35137da.tar.bz2
ice-fc32c2a7805365e7f40ab8a664f94efae35137da.tar.xz
ice-fc32c2a7805365e7f40ab8a664f94efae35137da.zip
- ICE-6845 - More dispatcher fixes for Python
- Deprecated the InitializationData.threadHook member - Added threadStart and threadStop members to InitializationData - InitializationData.batchRequestInterceptor can now be a callable
Diffstat (limited to 'python/modules/IcePy/BatchRequestInterceptor.cpp')
-rw-r--r--python/modules/IcePy/BatchRequestInterceptor.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/python/modules/IcePy/BatchRequestInterceptor.cpp b/python/modules/IcePy/BatchRequestInterceptor.cpp
index 95e7ed1345a..83577944689 100644
--- a/python/modules/IcePy/BatchRequestInterceptor.cpp
+++ b/python/modules/IcePy/BatchRequestInterceptor.cpp
@@ -237,6 +237,12 @@ IcePy::initBatchRequest(PyObject* module)
IcePy::BatchRequestInterceptor::BatchRequestInterceptor(PyObject* interceptor) : _interceptor(interceptor)
{
+ if(!PyCallable_Check(interceptor) && !PyObject_HasAttrString(interceptor, STRCAST("enqueue")))
+ {
+ throw Ice::InitializationException(__FILE__, __LINE__,
+ "batch request interceptor must either be a callable or an object with an 'enqueue' method");
+ }
+
Py_INCREF(interceptor);
}