Mercurial > hg
changeset 14237:4d684d8210a1
rename util.set_signal_handler to setsignalhandler
author | Adrian Buehlmann <adrian@cadifra.com> |
---|---|
date | Fri, 06 May 2011 15:41:04 +0200 |
parents | e949a008999d |
children | d466d592e8cf |
files | mercurial/commands.py mercurial/posix.py mercurial/win32.py |
diffstat | 3 files changed, 6 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/commands.py Fri May 06 15:36:05 2011 +0200 +++ b/mercurial/commands.py Fri May 06 15:41:04 2011 +0200 @@ -3756,7 +3756,7 @@ class service(object): def init(self): - util.set_signal_handler() + util.setsignalhandler() self.httpd = hgweb.server.create_server(ui, app) if opts['port'] and not ui.verbose:
--- a/mercurial/posix.py Fri May 06 15:36:05 2011 +0200 +++ b/mercurial/posix.py Fri May 06 15:41:04 2011 +0200 @@ -244,7 +244,7 @@ return executable return None -def set_signal_handler(): +def setsignalhandler(): pass def statfiles(files):
--- a/mercurial/win32.py Fri May 06 15:36:05 2011 +0200 +++ b/mercurial/win32.py Fri May 06 15:41:04 2011 +0200 @@ -239,9 +239,9 @@ return buf.value _SIGNAL_HANDLER = ctypes.WINFUNCTYPE(_BOOL, _DWORD) -_signal_handler = [] +_signalhandler = [] -def set_signal_handler(): +def setsignalhandler(): '''Register a termination handler for console events including CTRL+C. python signal handlers do not work well with socket operations. @@ -249,10 +249,10 @@ def handler(event): _kernel32.ExitProcess(1) - if _signal_handler: + if _signalhandler: return # already registered h = _SIGNAL_HANDLER(handler) - _signal_handler.append(h) # needed to prevent garbage collection + _signalhandler.append(h) # needed to prevent garbage collection if not _kernel32.SetConsoleCtrlHandler(h, True): raise ctypes.WinError()