# HG changeset patch # User Thomas Arendsen Hein # Date 2012-04-04 08:57:48 # Node ID 9f98fe05ecf104ab79cdd7ed15afc1fef7541c39 # Parent 4d875bb546dc03db33630f5388d7e04939c386a0 inotify: catch SignalInterrupt during shutdown (issue3351) When inotify.repowatcher.shutdown() is called, mercurial.error.SignalInterrupt exception is thrown by mercurial.dispatch._runcatch.catchterm(), therefore socketlistener.shutdown() is not called. Catching this allows cleanup action (removing the socket file) to proceed. diff --git a/hgext/inotify/linuxserver.py b/hgext/inotify/linuxserver.py --- a/hgext/inotify/linuxserver.py +++ b/hgext/inotify/linuxserver.py @@ -7,7 +7,7 @@ # GNU General Public License version 2 or any later version. from mercurial.i18n import _ -from mercurial import osutil, util +from mercurial import osutil, util, error import server import errno, os, select, stat, sys, time @@ -431,7 +431,10 @@ class master(object): def shutdown(self): for obj in pollable.instances.itervalues(): - obj.shutdown() + try: + obj.shutdown() + except error.SignalInterrupt: + pass def run(self): self.repowatcher.setup()