summaryrefslogtreecommitdiff
path: root/python/modules
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2017-07-11 12:31:54 +0200
committerBenoit Foucher <benoit@zeroc.com>2017-07-11 12:31:54 +0200
commitd4629a4e43f83c13f606cfd59d264a626d34dd4c (patch)
tree080a2206154f65311eeedde45a0dcc63ee63fdf8 /python/modules
parentRevert "Added JUnit XML reports to allTests.py" (diff)
downloadice-d4629a4e43f83c13f606cfd59d264a626d34dd4c.tar.bz2
ice-d4629a4e43f83c13f606cfd59d264a626d34dd4c.tar.xz
ice-d4629a4e43f83c13f606cfd59d264a626d34dd4c.zip
Fix for ICE-8245 - Python Ice/exceptions hang
Diffstat (limited to 'python/modules')
-rw-r--r--python/modules/IcePy/Operation.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/python/modules/IcePy/Operation.cpp b/python/modules/IcePy/Operation.cpp
index 8804f18d28c..25f580c24d3 100644
--- a/python/modules/IcePy/Operation.cpp
+++ b/python/modules/IcePy/Operation.cpp
@@ -2870,12 +2870,14 @@ IcePy::NewAsyncInvocation::exception(const Ice::Exception& ex)
{
AdoptThread adoptThread; // Ensure the current thread is able to call into Python.
+ PyObjectHandle exh = convertException(ex); // NOTE: This can release the GIL
+
if(!_future)
{
//
// The future hasn't been created yet, which means invoke() is still running. Save the exception for later.
//
- _exception = convertException(ex);
+ _exception = exh.release();
_done = true;
return;
}
@@ -2884,7 +2886,6 @@ IcePy::NewAsyncInvocation::exception(const Ice::Exception& ex)
_future = 0; // Break cyclic dependency.
_done = true;
- PyObjectHandle exh = convertException(ex);
assert(exh.get());
PyObjectHandle tmp = callMethod(future.get(), "set_exception", exh.get());
if(PyErr_Occurred())