mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
Improve exception handling across rpc interface
Modified Files: rpc.py
This commit is contained in:
parent
e87ab3fefe
commit
a552e3a0c9
1 changed files with 4 additions and 1 deletions
|
|
@ -208,7 +208,7 @@ class SocketIO:
|
||||||
if how == "EXCEPTION":
|
if how == "EXCEPTION":
|
||||||
mod, name, args, tb = what
|
mod, name, args, tb = what
|
||||||
self.traceback = tb
|
self.traceback = tb
|
||||||
if mod:
|
if mod: # not string exception
|
||||||
try:
|
try:
|
||||||
__import__(mod)
|
__import__(mod)
|
||||||
module = sys.modules[mod]
|
module = sys.modules[mod]
|
||||||
|
|
@ -220,7 +220,10 @@ class SocketIO:
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
|
# instantiate a built-in exception object and raise it
|
||||||
raise getattr(__import__(mod), name)(*args)
|
raise getattr(__import__(mod), name)(*args)
|
||||||
|
name = mod + "." + name
|
||||||
|
# do the best we can:
|
||||||
raise name, args
|
raise name, args
|
||||||
if how == "ERROR":
|
if how == "ERROR":
|
||||||
raise RuntimeError, what
|
raise RuntimeError, what
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue