[pypy-commit] pyrepl default: Copy the changeset 824b72bb6b45 from pypy's main repo:

arigo noreply at buildbot.pypy.org
Mon Jul 25 13:37:33 CEST 2011


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r124:714bcbd37203
Date: 2011-07-25 13:36 +0200
http://bitbucket.org/pypy/pyrepl/changeset/714bcbd37203/

Log:	Copy the changeset 824b72bb6b45 from pypy's main repo: on top of
	both CPython and PyPy, signal.signal() raises ValueError when called
	from a non-main thread. In this case just ignore setting up the
	signal handler, for now.

diff --git a/pyrepl/unix_console.py b/pyrepl/unix_console.py
--- a/pyrepl/unix_console.py
+++ b/pyrepl/unix_console.py
@@ -384,14 +384,18 @@
 
         self.__maybe_write_code(self._smkx)
 
+        try:
         self.old_sigwinch = signal.signal(
             signal.SIGWINCH, self.__sigwinch)
+        except ValueError:
+            pass
 
     def restore(self):
         self.__maybe_write_code(self._rmkx)
         self.flushoutput()
         tcsetattr(self.input_fd, termios.TCSADRAIN, self.__svtermstate)
 
+        if hasattr(self, 'old_sigwinch'):
         signal.signal(signal.SIGWINCH, self.old_sigwinch)
 
     def __sigwinch(self, signum, frame):


More information about the pypy-commit mailing list