From: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com> Date: Mon, 5 May 2025 21:13:08 +0000 (+0100) Subject: [3.13] gh-132017: Handle SIGCONT in `pyrepl` (#132918) (#133470) X-Git-Tag: v3.13.4~159 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1dfe5def081bf8e05706df4cbd6b5590e191e70b;p=thirdparty%2FPython%2Fcpython.git [3.13] gh-132017: Handle SIGCONT in `pyrepl` (#132918) (#133470) --- diff --git a/Lib/_pyrepl/unix_console.py b/Lib/_pyrepl/unix_console.py index e69c96b11598..5b0c2fef92c0 100644 --- a/Lib/_pyrepl/unix_console.py +++ b/Lib/_pyrepl/unix_console.py @@ -199,6 +199,12 @@ class UnixConsole(Console): self.event_queue = EventQueue(self.input_fd, self.encoding) self.cursor_visible = 1 + signal.signal(signal.SIGCONT, self._sigcont_handler) + + def _sigcont_handler(self, signum, frame): + self.restore() + self.prepare() + def more_in_buffer(self) -> bool: return bool( self.input_buffer diff --git a/Misc/NEWS.d/next/Library/2025-04-25-10-51-00.gh-issue-132017.SIGCONT1.rst b/Misc/NEWS.d/next/Library/2025-04-25-10-51-00.gh-issue-132017.SIGCONT1.rst new file mode 100644 index 000000000000..a11ccb9e07e0 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2025-04-25-10-51-00.gh-issue-132017.SIGCONT1.rst @@ -0,0 +1 @@ +Fix error when ``pyrepl`` is suspended, then resumed and terminated.