summaryrefslogtreecommitdiff
path: root/python/modules/IcePy/Operation.cpp
diff options
context:
space:
mode:
authorMark Spruiell <mes@zeroc.com>2016-08-31 11:20:16 -0700
committerMark Spruiell <mes@zeroc.com>2016-08-31 11:20:16 -0700
commit1a66d2263754da164ea36fccf2aae068cf7967a6 (patch)
treecf4ea51c11e2b498d5338c1b8637b81d6b3a2232 /python/modules/IcePy/Operation.cpp
parentminor clean up in java8 Incoming (diff)
downloadice-1a66d2263754da164ea36fccf2aae068cf7967a6.tar.bz2
ice-1a66d2263754da164ea36fccf2aae068cf7967a6.tar.xz
ice-1a66d2263754da164ea36fccf2aae068cf7967a6.zip
disable user exception validation on server side for Python
Diffstat (limited to 'python/modules/IcePy/Operation.cpp')
-rw-r--r--python/modules/IcePy/Operation.cpp40
1 files changed, 9 insertions, 31 deletions
diff --git a/python/modules/IcePy/Operation.cpp b/python/modules/IcePy/Operation.cpp
index ec2fa8713fd..3b59074a8e5 100644
--- a/python/modules/IcePy/Operation.cpp
+++ b/python/modules/IcePy/Operation.cpp
@@ -285,8 +285,6 @@ public:
private:
- bool validateException(PyObject*) const;
-
OperationPtr _op;
Ice::AMD_Object_ice_invokePtr _callback;
Ice::CommunicatorPtr _communicator;
@@ -3561,29 +3559,23 @@ IcePy::TypedUpcall::exception(PyException& ex, const Ice::EncodingVersion& encod
if(PyObject_IsInstance(ex.ex.get(), userExceptionType))
{
//
- // Get the exception's type and verify that it is legal to be thrown from this operation.
+ // Get the exception's type.
//
PyObjectHandle iceType = PyObject_GetAttrString(ex.ex.get(), STRCAST("_ice_type"));
assert(iceType.get());
ExceptionInfoPtr info = ExceptionInfoPtr::dynamicCast(getException(iceType.get()));
assert(info);
- if(!validateException(ex.ex.get()))
- {
- ex.raise(); // Raises UnknownUserException.
- }
- else
- {
- Ice::OutputStream os(_communicator);
- os.startEncapsulation(encoding, _op->format);
- ExceptionWriter writer(ex.ex, info);
- os.writeException(writer);
+ Ice::OutputStream os(_communicator);
+ os.startEncapsulation(encoding, _op->format);
- os.endEncapsulation();
+ ExceptionWriter writer(ex.ex, info);
+ os.writeException(writer);
- AllowThreads allowThreads; // Release Python's global interpreter lock during blocking calls.
- _callback->ice_response(false, os.finished());
- }
+ os.endEncapsulation();
+
+ AllowThreads allowThreads; // Release Python's global interpreter lock during blocking calls.
+ _callback->ice_response(false, os.finished());
}
else
{
@@ -3602,20 +3594,6 @@ IcePy::TypedUpcall::exception(PyException& ex, const Ice::EncodingVersion& encod
}
}
-bool
-IcePy::TypedUpcall::validateException(PyObject* ex) const
-{
- for(ExceptionInfoList::const_iterator p = _op->exceptions.begin(); p != _op->exceptions.end(); ++p)
- {
- if(PyObject_IsInstance(ex, (*p)->pythonType.get()))
- {
- return true;
- }
- }
-
- return false;
-}
-
//
// BlobjectUpcall
//