crecord: ensure we reinstall the SIGWINCH handler
authorPierre-Yves David <pierre-yves.david@ens-lyon.org>
Sun, 26 Mar 2017 15:06:09 +0200
changeset 31930 7e7743a01103
parent 31929 bf6b44da1d8e
child 31931 0130c3e1b1d9
crecord: ensure we reinstall the SIGWINCH handler Previous, exception in _main(...) would prevent the reinstallation of the signal.
mercurial/crecord.py
--- a/mercurial/crecord.py	Sun Mar 26 15:05:12 2017 +0200
+++ b/mercurial/crecord.py	Sun Mar 26 15:06:09 2017 +0200
@@ -1616,8 +1616,10 @@
 
         origsigwinchhandler = signal.signal(signal.SIGWINCH,
                                             self.sigwinchhandler)
-        return self._main(stdscr)
-        signal.signal(signal.SIGWINCH, origsigwinchhandler)
+        try:
+            return self._main(stdscr)
+        finally:
+            signal.signal(signal.SIGWINCH, origsigwinchhandler)
 
     def _main(self, stdscr):
         self.stdscr = stdscr