We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9df1fcb commit d1e0fd2Copy full SHA for d1e0fd2
pyrepl/unix_console.py
@@ -392,8 +392,12 @@ def restore(self):
392
tcsetattr(self.input_fd, termios.TCSADRAIN, self.__svtermstate)
393
394
if hasattr(self, 'old_sigwinch'):
395
- signal.signal(signal.SIGWINCH, self.old_sigwinch)
396
- del self.old_sigwinch
+ try:
+ signal.signal(signal.SIGWINCH, self.old_sigwinch)
397
+ del self.old_sigwinch
398
+ except ValueError:
399
+ # signal only works in main thread.
400
+ pass
401
402
def __sigwinch(self, signum, frame):
403
self.height, self.width = self.getheightwidth()
0 commit comments