[pypy-commit] pypy py3.6: Fix for issue #3003

arigo pypy.commits at gmail.com
Thu Apr 18 06:17:59 EDT 2019


Author: Armin Rigo <arigo at tunes.org>
Branch: py3.6
Changeset: r96521:76db7b07a3b8
Date: 2019-04-18 12:17 +0200
http://bitbucket.org/pypy/pypy/changeset/76db7b07a3b8/

Log:	Fix for issue #3003

diff --git a/lib-python/3/pdb.py b/lib-python/3/pdb.py
--- a/lib-python/3/pdb.py
+++ b/lib-python/3/pdb.py
@@ -341,8 +341,14 @@
     def interaction(self, frame, traceback):
         # Restore the previous signal handler at the Pdb prompt.
         if Pdb._previous_sigint_handler:
-            signal.signal(signal.SIGINT, Pdb._previous_sigint_handler)
-            Pdb._previous_sigint_handler = None
+            try:
+                signal.signal(signal.SIGINT, Pdb._previous_sigint_handler)
+                Pdb._previous_sigint_handler = None
+            except ValueError:
+                # ValueError happens when we're in a non-main thread,
+                # if we already invoked pdb in the same program from the
+                # main thread.  (PyPy fix)
+                pass
         if self.setup(frame, traceback):
             # no interaction desired at this time (happens if .pdbrc contains
             # a command like "continue")


More information about the pypy-commit mailing list