From d4629a4e43f83c13f606cfd59d264a626d34dd4c Mon Sep 17 00:00:00 2001 From: Benoit Foucher Date: Tue, 11 Jul 2017 12:31:54 +0200 Subject: Fix for ICE-8245 - Python Ice/exceptions hang --- python/modules/IcePy/Operation.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'python/modules/IcePy/Operation.cpp') 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()) -- cgit v1.2.3