| 400 | |
| 401 | |
| 402 | class MyRPCServer(rpc.RPCServer): |
| 403 | |
| 404 | def handle_error(self, request, client_address): |
| 405 | """Override RPCServer method for IDLE |
| 406 | |
| 407 | Interrupt the MainThread and exit server if link is dropped. |
| 408 | |
| 409 | """ |
| 410 | global quitting |
| 411 | try: |
| 412 | raise |
| 413 | except SystemExit: |
| 414 | raise |
| 415 | except EOFError: |
| 416 | global exit_now |
| 417 | exit_now = True |
| 418 | thread.interrupt_main() |
| 419 | except: |
| 420 | erf = sys.__stderr__ |
| 421 | print(textwrap.dedent(f""" |
| 422 | {'-'*40} |
| 423 | Unhandled exception in user code execution server!' |
| 424 | Thread: {threading.current_thread().name} |
| 425 | IDLE Client Address: {client_address} |
| 426 | Request: {request!r} |
| 427 | """), file=erf) |
| 428 | traceback.print_exc(limit=-20, file=erf) |
| 429 | print(textwrap.dedent(f""" |
| 430 | *** Unrecoverable, server exiting! |
| 431 | |
| 432 | Users should never see this message; it is likely transient. |
| 433 | If this recurs, report this with a copy of the message |
| 434 | and an explanation of how to make it repeat. |
| 435 | {'-'*40}"""), file=erf) |
| 436 | quitting = True |
| 437 | thread.interrupt_main() |
| 438 | |
| 439 | |
| 440 | # Pseudofiles for shell-remote communication (also used in pyshell) |
no outgoing calls
no test coverage detected
searching dependent graphs…