[PATCH 2 of 5 STABLE] crecord: ensure we reinstall the SIGWINCH handler

Pierre-Yves David pierre-yves.david at ens-lyon.org
Wed Apr 12 08:41:17 UTC 2017


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at ens-lyon.org>
# Date 1490533569 -7200
#      Sun Mar 26 15:06:09 2017 +0200
# Branch stable
# Node ID 85d5c3551f2b44399418e00fd62630344694ed1c
# Parent  a8c09dc71f99e929d2545ee4366231aa98d73d9d
# EXP-Topic crecord-windows
# Available At https://www.mercurial-scm.org/repo/users/marmoute/mercurial/
#              hg pull https://www.mercurial-scm.org/repo/users/marmoute/mercurial/ -r 85d5c3551f2b
crecord: ensure we reinstall the SIGWINCH handler

Previous, exception in _main(...) would prevent the reinstallation of the
signal.

diff --git a/mercurial/crecord.py b/mercurial/crecord.py
--- a/mercurial/crecord.py
+++ b/mercurial/crecord.py
@@ -1613,8 +1613,10 @@ are you sure you want to review/edit and
 
         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



More information about the Mercurial-devel mailing list