Improve exception handling across rpc interface
authorKurt B. Kaiser <kbk@shore.net>
Sat, 24 Aug 2002 23:57:17 +0000 (23:57 +0000)
committerKurt B. Kaiser <kbk@shore.net>
Sat, 24 Aug 2002 23:57:17 +0000 (23:57 +0000)
Modified Files:
  rpc.py

Lib/idlelib/rpc.py

index 5bb0e646f19215a7cbf52872842beaf1fbcce5a2..922a460c0c5d45639549d35aecc9af5717632fb2 100644 (file)
@@ -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