mirror of
https://github.com/NaN-tic/tryton-gtk2.git
synced 2023-12-14 03:12:58 +01:00
Process exception during the callback
As process exception may raise an exception, it should be run in the callback to let the caller catch it. Otherwise it is raised in the thread and never catch. issue6907 review42811003
This commit is contained in:
parent
413deb4271
commit
ba37e1f7bb
1 changed files with 6 additions and 8 deletions
|
@ -1191,17 +1191,15 @@ class RPCProgress(object):
|
|||
def process(self):
|
||||
if self.parent and self.parent.get_window():
|
||||
self.parent.get_window().set_cursor(None)
|
||||
if self.exception:
|
||||
if self.process_exception_p:
|
||||
def rpc_execute(*args):
|
||||
return RPCProgress('execute',
|
||||
args).run(self.process_exception_p, self.callback)
|
||||
return process_exception(self.exception, *self.args,
|
||||
rpc_execute=rpc_execute)
|
||||
|
||||
def return_():
|
||||
if self.exception:
|
||||
raise self.exception
|
||||
if self.process_exception_p:
|
||||
def rpc_execute(*args):
|
||||
return RPCProgress('execute',
|
||||
args).run(self.process_exception_p, self.callback)
|
||||
return process_exception(self.exception, *self.args,
|
||||
rpc_execute=rpc_execute)
|
||||
else:
|
||||
return self.res
|
||||
|
||||
|
|
Loading…
Reference in a new issue