| 404 | self._safe_repr(oldvalue, expr))) |
| 405 | |
| 406 | def interaction(self, frame, traceback): |
| 407 | # Restore the previous signal handler at the Pdb prompt. |
| 408 | if Pdb._previous_sigint_handler: |
| 409 | try: |
| 410 | signal.signal(signal.SIGINT, Pdb._previous_sigint_handler) |
| 411 | except ValueError: # ValueError: signal only works in main thread |
| 412 | pass |
| 413 | else: |
| 414 | Pdb._previous_sigint_handler = None |
| 415 | self.setup(frame, traceback) |
| 416 | # if we have more commands to process, do not show the stack entry |
| 417 | if not self.cmdqueue: |
| 418 | self.print_stack_entry(self.stack[self.curindex]) |
| 419 | self._cmdloop() |
| 420 | self.forget() |
| 421 | |
| 422 | def displayhook(self, obj): |
| 423 | """Custom displayhook for the exec in default(), which prevents |