Chui Tey | 5d2af63 | 2002-05-26 13:36:41 +0000 | [diff] [blame] | 1 | import sys |
Kurt B. Kaiser | a00050f | 2003-05-08 20:26:55 +0000 | [diff] [blame] | 2 | import os |
Kurt B. Kaiser | b417936 | 2002-07-26 00:06:42 +0000 | [diff] [blame] | 3 | import time |
| 4 | import socket |
Kurt B. Kaiser | 86bc464 | 2003-02-27 23:04:17 +0000 | [diff] [blame] | 5 | import traceback |
Kurt B. Kaiser | 93e8e54 | 2003-06-13 22:03:43 +0000 | [diff] [blame] | 6 | import thread |
Kurt B. Kaiser | 11c53e2 | 2003-03-22 19:40:19 +0000 | [diff] [blame] | 7 | import threading |
| 8 | import Queue |
Kurt B. Kaiser | 5afa1df | 2002-10-10 08:25:24 +0000 | [diff] [blame] | 9 | |
| 10 | import CallTips |
| 11 | import RemoteDebugger |
| 12 | import RemoteObjectBrowser |
| 13 | import StackViewer |
Chui Tey | 5d2af63 | 2002-05-26 13:36:41 +0000 | [diff] [blame] | 14 | import rpc |
| 15 | |
Kurt B. Kaiser | 5afa1df | 2002-10-10 08:25:24 +0000 | [diff] [blame] | 16 | import __main__ |
| 17 | |
Kurt B. Kaiser | 24d7e0c | 2003-06-05 23:51:29 +0000 | [diff] [blame] | 18 | LOCALHOST = '127.0.0.1' |
| 19 | |
Kurt B. Kaiser | 11c53e2 | 2003-03-22 19:40:19 +0000 | [diff] [blame] | 20 | # Thread shared globals: Establish a queue between a subthread (which handles |
| 21 | # the socket) and the main thread (which runs user code), plus global |
| 22 | # completion and exit flags: |
| 23 | |
Kurt B. Kaiser | 67fd0ea | 2003-05-24 20:59:15 +0000 | [diff] [blame] | 24 | exit_now = False |
| 25 | quitting = False |
Kurt B. Kaiser | 11c53e2 | 2003-03-22 19:40:19 +0000 | [diff] [blame] | 26 | |
Kurt B. Kaiser | 62df044 | 2003-05-28 01:47:46 +0000 | [diff] [blame] | 27 | def main(del_exitfunc=False): |
Kurt B. Kaiser | b417936 | 2002-07-26 00:06:42 +0000 | [diff] [blame] | 28 | """Start the Python execution server in a subprocess |
| 29 | |
Kurt B. Kaiser | 5afa1df | 2002-10-10 08:25:24 +0000 | [diff] [blame] | 30 | In the Python subprocess, RPCServer is instantiated with handlerclass |
| 31 | MyHandler, which inherits register/unregister methods from RPCHandler via |
| 32 | the mix-in class SocketIO. |
Kurt B. Kaiser | b417936 | 2002-07-26 00:06:42 +0000 | [diff] [blame] | 33 | |
Kurt B. Kaiser | 11c53e2 | 2003-03-22 19:40:19 +0000 | [diff] [blame] | 34 | When the RPCServer 'server' is instantiated, the TCPServer initialization |
Kurt B. Kaiser | 5afa1df | 2002-10-10 08:25:24 +0000 | [diff] [blame] | 35 | creates an instance of run.MyHandler and calls its handle() method. |
| 36 | handle() instantiates a run.Executive object, passing it a reference to the |
| 37 | MyHandler object. That reference is saved as attribute rpchandler of the |
| 38 | Executive instance. The Executive methods have access to the reference and |
| 39 | can pass it on to entities that they command |
| 40 | (e.g. RemoteDebugger.Debugger.start_debugger()). The latter, in turn, can |
| 41 | call MyHandler(SocketIO) register/unregister methods via the reference to |
| 42 | register and unregister themselves. |
Kurt B. Kaiser | b417936 | 2002-07-26 00:06:42 +0000 | [diff] [blame] | 43 | |
| 44 | """ |
Kurt B. Kaiser | 67fd0ea | 2003-05-24 20:59:15 +0000 | [diff] [blame] | 45 | global exit_now |
| 46 | global quitting |
Kurt B. Kaiser | 62df044 | 2003-05-28 01:47:46 +0000 | [diff] [blame] | 47 | global no_exitfunc |
| 48 | no_exitfunc = del_exitfunc |
Chui Tey | 5d2af63 | 2002-05-26 13:36:41 +0000 | [diff] [blame] | 49 | port = 8833 |
Kurt B. Kaiser | af3eb87 | 2004-01-21 18:54:30 +0000 | [diff] [blame] | 50 | #time.sleep(15) # test subprocess not responding |
Chui Tey | 5d2af63 | 2002-05-26 13:36:41 +0000 | [diff] [blame] | 51 | if sys.argv[1:]: |
| 52 | port = int(sys.argv[1]) |
| 53 | sys.argv[:] = [""] |
Kurt B. Kaiser | 11c53e2 | 2003-03-22 19:40:19 +0000 | [diff] [blame] | 54 | sockthread = threading.Thread(target=manage_socket, |
| 55 | name='SockThread', |
Kurt B. Kaiser | 24d7e0c | 2003-06-05 23:51:29 +0000 | [diff] [blame] | 56 | args=((LOCALHOST, port),)) |
Kurt B. Kaiser | 11c53e2 | 2003-03-22 19:40:19 +0000 | [diff] [blame] | 57 | sockthread.setDaemon(True) |
| 58 | sockthread.start() |
| 59 | while 1: |
| 60 | try: |
Kurt B. Kaiser | 67fd0ea | 2003-05-24 20:59:15 +0000 | [diff] [blame] | 61 | if exit_now: |
| 62 | try: |
Kurt B. Kaiser | 62df044 | 2003-05-28 01:47:46 +0000 | [diff] [blame] | 63 | exit() |
Kurt B. Kaiser | 67fd0ea | 2003-05-24 20:59:15 +0000 | [diff] [blame] | 64 | except KeyboardInterrupt: |
| 65 | # exiting but got an extra KBI? Try again! |
| 66 | continue |
Kurt B. Kaiser | a00050f | 2003-05-08 20:26:55 +0000 | [diff] [blame] | 67 | try: |
| 68 | seq, request = rpc.request_queue.get(0) |
| 69 | except Queue.Empty: |
| 70 | time.sleep(0.05) |
| 71 | continue |
| 72 | method, args, kwargs = request |
| 73 | ret = method(*args, **kwargs) |
| 74 | rpc.response_queue.put((seq, ret)) |
Kurt B. Kaiser | aa6b856 | 2003-05-14 18:15:40 +0000 | [diff] [blame] | 75 | except KeyboardInterrupt: |
Kurt B. Kaiser | 67fd0ea | 2003-05-24 20:59:15 +0000 | [diff] [blame] | 76 | if quitting: |
| 77 | exit_now = True |
Kurt B. Kaiser | aa6b856 | 2003-05-14 18:15:40 +0000 | [diff] [blame] | 78 | continue |
Kurt B. Kaiser | a2792be | 2003-05-17 21:04:10 +0000 | [diff] [blame] | 79 | except SystemExit: |
| 80 | raise |
Kurt B. Kaiser | 9ec454e | 2003-05-12 02:33:47 +0000 | [diff] [blame] | 81 | except: |
Kurt B. Kaiser | 67fd0ea | 2003-05-24 20:59:15 +0000 | [diff] [blame] | 82 | type, value, tb = sys.exc_info() |
Kurt B. Kaiser | a2792be | 2003-05-17 21:04:10 +0000 | [diff] [blame] | 83 | try: |
| 84 | print_exception() |
| 85 | rpc.response_queue.put((seq, None)) |
| 86 | except: |
Kurt B. Kaiser | 67fd0ea | 2003-05-24 20:59:15 +0000 | [diff] [blame] | 87 | # Link didn't work, print same exception to __stderr__ |
| 88 | traceback.print_exception(type, value, tb, file=sys.__stderr__) |
Kurt B. Kaiser | 62df044 | 2003-05-28 01:47:46 +0000 | [diff] [blame] | 89 | exit() |
Kurt B. Kaiser | 67fd0ea | 2003-05-24 20:59:15 +0000 | [diff] [blame] | 90 | else: |
| 91 | continue |
Kurt B. Kaiser | 11c53e2 | 2003-03-22 19:40:19 +0000 | [diff] [blame] | 92 | |
| 93 | def manage_socket(address): |
Kurt B. Kaiser | af3eb87 | 2004-01-21 18:54:30 +0000 | [diff] [blame] | 94 | for i in range(3): |
Kurt B. Kaiser | b417936 | 2002-07-26 00:06:42 +0000 | [diff] [blame] | 95 | time.sleep(i) |
| 96 | try: |
Kurt B. Kaiser | a00050f | 2003-05-08 20:26:55 +0000 | [diff] [blame] | 97 | server = MyRPCServer(address, MyHandler) |
Kurt B. Kaiser | b417936 | 2002-07-26 00:06:42 +0000 | [diff] [blame] | 98 | break |
| 99 | except socket.error, err: |
Kurt B. Kaiser | af3eb87 | 2004-01-21 18:54:30 +0000 | [diff] [blame] | 100 | print>>sys.__stderr__,"IDLE Subprocess: socket error: "\ |
| 101 | + err[1] + ", retrying...." |
Kurt B. Kaiser | b417936 | 2002-07-26 00:06:42 +0000 | [diff] [blame] | 102 | else: |
Kurt B. Kaiser | af3eb87 | 2004-01-21 18:54:30 +0000 | [diff] [blame] | 103 | print>>sys.__stderr__, "IDLE Subprocess: Connection to "\ |
| 104 | "IDLE GUI failed, exiting." |
| 105 | show_socket_error(err, address) |
Kurt B. Kaiser | 67fd0ea | 2003-05-24 20:59:15 +0000 | [diff] [blame] | 106 | global exit_now |
| 107 | exit_now = True |
Kurt B. Kaiser | a00050f | 2003-05-08 20:26:55 +0000 | [diff] [blame] | 108 | return |
Kurt B. Kaiser | 11c53e2 | 2003-03-22 19:40:19 +0000 | [diff] [blame] | 109 | server.handle_request() # A single request only |
| 110 | |
Kurt B. Kaiser | af3eb87 | 2004-01-21 18:54:30 +0000 | [diff] [blame] | 111 | def show_socket_error(err, address): |
| 112 | import Tkinter |
| 113 | import tkMessageBox |
| 114 | root = Tkinter.Tk() |
| 115 | root.withdraw() |
| 116 | if err[0] == 61: # connection refused |
| 117 | msg = "IDLE's subprocess can't connect to %s:%d. This may be due "\ |
| 118 | "to your personal firewall configuration. It is safe to "\ |
| 119 | "allow this internal connection because no data is visible on "\ |
| 120 | "external ports." % address |
| 121 | tkMessageBox.showerror("IDLE Subprocess Error", msg, parent=root) |
| 122 | else: |
| 123 | tkMessageBox.showerror("IDLE Subprocess Error", "Socket Error: %s" % err[1]) |
| 124 | root.destroy() |
| 125 | |
Kurt B. Kaiser | 9ec454e | 2003-05-12 02:33:47 +0000 | [diff] [blame] | 126 | def print_exception(): |
Kurt B. Kaiser | e9802a3 | 2004-01-02 04:04:04 +0000 | [diff] [blame] | 127 | import linecache |
| 128 | linecache.checkcache() |
Kurt B. Kaiser | 9ec454e | 2003-05-12 02:33:47 +0000 | [diff] [blame] | 129 | flush_stdout() |
| 130 | efile = sys.stderr |
Kurt B. Kaiser | 924f616 | 2003-11-19 04:52:32 +0000 | [diff] [blame] | 131 | typ, val, tb = excinfo = sys.exc_info() |
| 132 | sys.last_type, sys.last_value, sys.last_traceback = excinfo |
Kurt B. Kaiser | 9ec454e | 2003-05-12 02:33:47 +0000 | [diff] [blame] | 133 | tbe = traceback.extract_tb(tb) |
Kurt B. Kaiser | af3eb87 | 2004-01-21 18:54:30 +0000 | [diff] [blame] | 134 | print>>efile, '\nTraceback (most recent call last):' |
Kurt B. Kaiser | 9ec454e | 2003-05-12 02:33:47 +0000 | [diff] [blame] | 135 | exclude = ("run.py", "rpc.py", "threading.py", "Queue.py", |
| 136 | "RemoteDebugger.py", "bdb.py") |
| 137 | cleanup_traceback(tbe, exclude) |
| 138 | traceback.print_list(tbe, file=efile) |
| 139 | lines = traceback.format_exception_only(typ, val) |
| 140 | for line in lines: |
| 141 | print>>efile, line, |
| 142 | |
| 143 | def cleanup_traceback(tb, exclude): |
| 144 | "Remove excluded traces from beginning/end of tb; get cached lines" |
| 145 | orig_tb = tb[:] |
| 146 | while tb: |
| 147 | for rpcfile in exclude: |
| 148 | if tb[0][0].count(rpcfile): |
| 149 | break # found an exclude, break for: and delete tb[0] |
| 150 | else: |
| 151 | break # no excludes, have left RPC code, break while: |
| 152 | del tb[0] |
| 153 | while tb: |
| 154 | for rpcfile in exclude: |
| 155 | if tb[-1][0].count(rpcfile): |
| 156 | break |
| 157 | else: |
| 158 | break |
| 159 | del tb[-1] |
| 160 | if len(tb) == 0: |
| 161 | # exception was in IDLE internals, don't prune! |
| 162 | tb[:] = orig_tb[:] |
| 163 | print>>sys.stderr, "** IDLE Internal Exception: " |
| 164 | rpchandler = rpc.objecttable['exec'].rpchandler |
| 165 | for i in range(len(tb)): |
| 166 | fn, ln, nm, line = tb[i] |
| 167 | if nm == '?': |
| 168 | nm = "-toplevel-" |
| 169 | if not line and fn.startswith("<pyshell#"): |
| 170 | line = rpchandler.remotecall('linecache', 'getline', |
| 171 | (fn, ln), {}) |
| 172 | tb[i] = fn, ln, nm, line |
| 173 | |
| 174 | def flush_stdout(): |
| 175 | try: |
| 176 | if sys.stdout.softspace: |
| 177 | sys.stdout.softspace = 0 |
| 178 | sys.stdout.write("\n") |
| 179 | except (AttributeError, EOFError): |
| 180 | pass |
| 181 | |
Kurt B. Kaiser | 62df044 | 2003-05-28 01:47:46 +0000 | [diff] [blame] | 182 | def exit(): |
| 183 | """Exit subprocess, possibly after first deleting sys.exitfunc |
| 184 | |
| 185 | If config-main.cfg/.def 'General' 'delete-exitfunc' is True, then any |
| 186 | sys.exitfunc will be removed before exiting. (VPython support) |
| 187 | |
| 188 | """ |
| 189 | if no_exitfunc: |
| 190 | del sys.exitfunc |
| 191 | sys.exit(0) |
Chui Tey | 5d2af63 | 2002-05-26 13:36:41 +0000 | [diff] [blame] | 192 | |
Kurt B. Kaiser | a00050f | 2003-05-08 20:26:55 +0000 | [diff] [blame] | 193 | class MyRPCServer(rpc.RPCServer): |
| 194 | |
| 195 | def handle_error(self, request, client_address): |
| 196 | """Override RPCServer method for IDLE |
| 197 | |
| 198 | Interrupt the MainThread and exit server if link is dropped. |
| 199 | |
| 200 | """ |
| 201 | try: |
| 202 | raise |
| 203 | except SystemExit: |
| 204 | raise |
| 205 | except EOFError: |
Kurt B. Kaiser | 67fd0ea | 2003-05-24 20:59:15 +0000 | [diff] [blame] | 206 | global exit_now |
| 207 | exit_now = True |
Kurt B. Kaiser | 93e8e54 | 2003-06-13 22:03:43 +0000 | [diff] [blame] | 208 | thread.interrupt_main() |
Kurt B. Kaiser | a00050f | 2003-05-08 20:26:55 +0000 | [diff] [blame] | 209 | except: |
| 210 | erf = sys.__stderr__ |
| 211 | print>>erf, '\n' + '-'*40 |
| 212 | print>>erf, 'Unhandled server exception!' |
| 213 | print>>erf, 'Thread: %s' % threading.currentThread().getName() |
| 214 | print>>erf, 'Client Address: ', client_address |
| 215 | print>>erf, 'Request: ', repr(request) |
| 216 | traceback.print_exc(file=erf) |
| 217 | print>>erf, '\n*** Unrecoverable, server exiting!' |
| 218 | print>>erf, '-'*40 |
Kurt B. Kaiser | 62df044 | 2003-05-28 01:47:46 +0000 | [diff] [blame] | 219 | exit() |
Kurt B. Kaiser | a00050f | 2003-05-08 20:26:55 +0000 | [diff] [blame] | 220 | |
| 221 | |
Chui Tey | 5d2af63 | 2002-05-26 13:36:41 +0000 | [diff] [blame] | 222 | class MyHandler(rpc.RPCHandler): |
| 223 | |
| 224 | def handle(self): |
Kurt B. Kaiser | 11c53e2 | 2003-03-22 19:40:19 +0000 | [diff] [blame] | 225 | """Override base method""" |
Chui Tey | 5d2af63 | 2002-05-26 13:36:41 +0000 | [diff] [blame] | 226 | executive = Executive(self) |
| 227 | self.register("exec", executive) |
Kurt B. Kaiser | 9f36609 | 2003-06-02 01:50:19 +0000 | [diff] [blame] | 228 | sys.stdin = self.console = self.get_remote_proxy("stdin") |
Chui Tey | 5d2af63 | 2002-05-26 13:36:41 +0000 | [diff] [blame] | 229 | sys.stdout = self.get_remote_proxy("stdout") |
| 230 | sys.stderr = self.get_remote_proxy("stderr") |
Martin v. Löwis | bcc651a | 2003-06-22 07:52:56 +0000 | [diff] [blame] | 231 | import IOBinding |
| 232 | sys.stdin.encoding = sys.stdout.encoding = \ |
| 233 | sys.stderr.encoding = IOBinding.encoding |
Kurt B. Kaiser | 9f36609 | 2003-06-02 01:50:19 +0000 | [diff] [blame] | 234 | self.interp = self.get_remote_proxy("interp") |
Kurt B. Kaiser | a00050f | 2003-05-08 20:26:55 +0000 | [diff] [blame] | 235 | rpc.RPCHandler.getresponse(self, myseq=None, wait=0.05) |
| 236 | |
| 237 | def exithook(self): |
| 238 | "override SocketIO method - wait for MainThread to shut us down" |
Kurt B. Kaiser | 67fd0ea | 2003-05-24 20:59:15 +0000 | [diff] [blame] | 239 | time.sleep(10) |
Kurt B. Kaiser | a00050f | 2003-05-08 20:26:55 +0000 | [diff] [blame] | 240 | |
| 241 | def EOFhook(self): |
| 242 | "Override SocketIO method - terminate wait on callback and exit thread" |
Kurt B. Kaiser | 67fd0ea | 2003-05-24 20:59:15 +0000 | [diff] [blame] | 243 | global quitting |
| 244 | quitting = True |
Kurt B. Kaiser | 93e8e54 | 2003-06-13 22:03:43 +0000 | [diff] [blame] | 245 | thread.interrupt_main() |
Kurt B. Kaiser | a00050f | 2003-05-08 20:26:55 +0000 | [diff] [blame] | 246 | |
| 247 | def decode_interrupthook(self): |
| 248 | "interrupt awakened thread" |
Kurt B. Kaiser | 67fd0ea | 2003-05-24 20:59:15 +0000 | [diff] [blame] | 249 | global quitting |
| 250 | quitting = True |
Kurt B. Kaiser | 93e8e54 | 2003-06-13 22:03:43 +0000 | [diff] [blame] | 251 | thread.interrupt_main() |
Kurt B. Kaiser | 11c53e2 | 2003-03-22 19:40:19 +0000 | [diff] [blame] | 252 | |
Chui Tey | 5d2af63 | 2002-05-26 13:36:41 +0000 | [diff] [blame] | 253 | |
| 254 | class Executive: |
| 255 | |
| 256 | def __init__(self, rpchandler): |
Kurt B. Kaiser | ffd3a42 | 2002-06-26 02:32:09 +0000 | [diff] [blame] | 257 | self.rpchandler = rpchandler |
Kurt B. Kaiser | adc6384 | 2002-08-25 14:08:07 +0000 | [diff] [blame] | 258 | self.locals = __main__.__dict__ |
Kurt B. Kaiser | 5afa1df | 2002-10-10 08:25:24 +0000 | [diff] [blame] | 259 | self.calltip = CallTips.CallTips() |
Chui Tey | 5d2af63 | 2002-05-26 13:36:41 +0000 | [diff] [blame] | 260 | |
| 261 | def runcode(self, code): |
Kurt B. Kaiser | 86bc464 | 2003-02-27 23:04:17 +0000 | [diff] [blame] | 262 | try: |
Kurt B. Kaiser | 9f36609 | 2003-06-02 01:50:19 +0000 | [diff] [blame] | 263 | self.usr_exc_info = None |
Kurt B. Kaiser | 86bc464 | 2003-02-27 23:04:17 +0000 | [diff] [blame] | 264 | exec code in self.locals |
| 265 | except: |
Kurt B. Kaiser | 9f36609 | 2003-06-02 01:50:19 +0000 | [diff] [blame] | 266 | self.usr_exc_info = sys.exc_info() |
Kurt B. Kaiser | 67fd0ea | 2003-05-24 20:59:15 +0000 | [diff] [blame] | 267 | if quitting: |
Kurt B. Kaiser | 62df044 | 2003-05-28 01:47:46 +0000 | [diff] [blame] | 268 | exit() |
Kurt B. Kaiser | 67fd0ea | 2003-05-24 20:59:15 +0000 | [diff] [blame] | 269 | # even print a user code SystemExit exception, continue |
| 270 | print_exception() |
Kurt B. Kaiser | 9f36609 | 2003-06-02 01:50:19 +0000 | [diff] [blame] | 271 | jit = self.rpchandler.console.getvar("<<toggle-jit-stack-viewer>>") |
| 272 | if jit: |
| 273 | self.rpchandler.interp.open_remote_stack_viewer() |
Kurt B. Kaiser | 11c53e2 | 2003-03-22 19:40:19 +0000 | [diff] [blame] | 274 | else: |
Kurt B. Kaiser | 9ec454e | 2003-05-12 02:33:47 +0000 | [diff] [blame] | 275 | flush_stdout() |
Chui Tey | 5d2af63 | 2002-05-26 13:36:41 +0000 | [diff] [blame] | 276 | |
Kurt B. Kaiser | 003091c | 2003-02-17 18:57:16 +0000 | [diff] [blame] | 277 | def interrupt_the_server(self): |
Kurt B. Kaiser | 93e8e54 | 2003-06-13 22:03:43 +0000 | [diff] [blame] | 278 | thread.interrupt_main() |
Kurt B. Kaiser | 11c53e2 | 2003-03-22 19:40:19 +0000 | [diff] [blame] | 279 | |
Kurt B. Kaiser | 0e3a577 | 2002-06-16 03:32:24 +0000 | [diff] [blame] | 280 | def start_the_debugger(self, gui_adap_oid): |
Kurt B. Kaiser | ffd3a42 | 2002-06-26 02:32:09 +0000 | [diff] [blame] | 281 | return RemoteDebugger.start_debugger(self.rpchandler, gui_adap_oid) |
| 282 | |
| 283 | def stop_the_debugger(self, idb_adap_oid): |
| 284 | "Unregister the Idb Adapter. Link objects and Idb then subject to GC" |
| 285 | self.rpchandler.unregister(idb_adap_oid) |
Chui Tey | 5d2af63 | 2002-05-26 13:36:41 +0000 | [diff] [blame] | 286 | |
Kurt B. Kaiser | 5afa1df | 2002-10-10 08:25:24 +0000 | [diff] [blame] | 287 | def get_the_calltip(self, name): |
| 288 | return self.calltip.fetch_tip(name) |
| 289 | |
Chui Tey | 5d2af63 | 2002-05-26 13:36:41 +0000 | [diff] [blame] | 290 | def stackviewer(self, flist_oid=None): |
Kurt B. Kaiser | 9f36609 | 2003-06-02 01:50:19 +0000 | [diff] [blame] | 291 | if self.usr_exc_info: |
| 292 | typ, val, tb = self.usr_exc_info |
| 293 | else: |
Chui Tey | 5d2af63 | 2002-05-26 13:36:41 +0000 | [diff] [blame] | 294 | return None |
| 295 | flist = None |
| 296 | if flist_oid is not None: |
Kurt B. Kaiser | ffd3a42 | 2002-06-26 02:32:09 +0000 | [diff] [blame] | 297 | flist = self.rpchandler.get_remote_proxy(flist_oid) |
Chui Tey | 5d2af63 | 2002-05-26 13:36:41 +0000 | [diff] [blame] | 298 | while tb and tb.tb_frame.f_globals["__name__"] in ["rpc", "run"]: |
| 299 | tb = tb.tb_next |
Kurt B. Kaiser | 9f36609 | 2003-06-02 01:50:19 +0000 | [diff] [blame] | 300 | sys.last_type = typ |
| 301 | sys.last_value = val |
Chui Tey | 5d2af63 | 2002-05-26 13:36:41 +0000 | [diff] [blame] | 302 | item = StackViewer.StackTreeItem(flist, tb) |
| 303 | return RemoteObjectBrowser.remote_object_tree_item(item) |