diff options
author | Andrew Svetlov <andrew.svetlov@gmail.com> | 2012-12-04 19:08:28 (GMT) |
---|---|---|
committer | Andrew Svetlov <andrew.svetlov@gmail.com> | 2012-12-04 19:08:28 (GMT) |
commit | 539ee5da6fb2a56869e6c6f4401300b4d5906d76 (patch) | |
tree | 98b32fae910ccb41a333319b65fcd19343cedb87 /Lib/pdb.py | |
parent | 86067c2e17b221ac10c4b4c97030c2cfc44eccaf (diff) | |
download | cpython-539ee5da6fb2a56869e6c6f4401300b4d5906d76.zip cpython-539ee5da6fb2a56869e6c6f4401300b4d5906d76.tar.gz cpython-539ee5da6fb2a56869e6c6f4401300b4d5906d76.tar.bz2 |
Issue #13120: Allow to call pdb.set_trace() from thread.
Patch by Ilya Sandler.
Diffstat (limited to 'Lib/pdb.py')
-rwxr-xr-x | Lib/pdb.py | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -955,8 +955,15 @@ class Pdb(bdb.Bdb, cmd.Cmd): Continue execution, only stop when a breakpoint is encountered. """ if not self.nosigint: - self._previous_sigint_handler = \ - signal.signal(signal.SIGINT, self.sigint_handler) + try: + self._previous_sigint_handler = \ + signal.signal(signal.SIGINT, self.sigint_handler) + except ValueError: + # ValueError happens when do_continue() is invoked from + # a non-main thread in which case we just continue without + # SIGINT set. Would printing a message here (once) make + # sense? + pass self.set_continue() return 1 do_c = do_cont = do_continue |