summaryrefslogtreecommitdiffstats
path: root/Lib/pdb.py
diff options
context:
space:
mode:
authorAndrew Svetlov <andrew.svetlov@gmail.com>2012-12-04 19:10:20 (GMT)
committerAndrew Svetlov <andrew.svetlov@gmail.com>2012-12-04 19:10:20 (GMT)
commit1dfb5c1cf3aac0a42b157631a0e8d274e5be8c6f (patch)
tree90cdb2b13e03256b55a63a62f818c6ce6cc4f497 /Lib/pdb.py
parent56a2ae27e3f142f5a92d43fab5296748ef8ecc98 (diff)
parent539ee5da6fb2a56869e6c6f4401300b4d5906d76 (diff)
downloadcpython-1dfb5c1cf3aac0a42b157631a0e8d274e5be8c6f.zip
cpython-1dfb5c1cf3aac0a42b157631a0e8d274e5be8c6f.tar.gz
cpython-1dfb5c1cf3aac0a42b157631a0e8d274e5be8c6f.tar.bz2
Merge issue #13120: Allow to call pdb.set_trace() from thread.
Patch by Ilya Sandler.
Diffstat (limited to 'Lib/pdb.py')
-rwxr-xr-xLib/pdb.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/Lib/pdb.py b/Lib/pdb.py
index 3043391..e6d7f8f 100755
--- a/Lib/pdb.py
+++ b/Lib/pdb.py
@@ -1031,8 +1031,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