From: Kurt B. Kaiser Date: Sat, 24 Aug 2002 23:57:17 +0000 (+0000) Subject: Improve exception handling across rpc interface X-Git-Tag: v2.3c1~4303 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a552e3a0c9aaa5f7540262159515c6798e5d8d7e;p=thirdparty%2FPython%2Fcpython.git Improve exception handling across rpc interface Modified Files: rpc.py --- diff --git a/Lib/idlelib/rpc.py b/Lib/idlelib/rpc.py index 5bb0e646f192..922a460c0c5d 100644 --- a/Lib/idlelib/rpc.py +++ b/Lib/idlelib/rpc.py @@ -208,7 +208,7 @@ class SocketIO: if how == "EXCEPTION": mod, name, args, tb = what self.traceback = tb - if mod: + if mod: # not string exception try: __import__(mod) module = sys.modules[mod] @@ -220,7 +220,10 @@ class SocketIO: except AttributeError: pass else: + # instantiate a built-in exception object and raise it raise getattr(__import__(mod), name)(*args) + name = mod + "." + name + # do the best we can: raise name, args if how == "ERROR": raise RuntimeError, what