comparison mercurial/util_win32.py @ 4672:272c0a09b203

Handle CTRL+C in serve under Windows.
author Marcos Chaves <marcos.nospam@gmail.com>
date Thu, 21 Jun 2007 21:58:18 +0200
parents f97b89314fb3
children 7549cd526b7f
comparison
equal deleted inserted replaced
4659:7a7d4937272b 4672:272c0a09b203
297 win32file.SetEndOfFile(self.handle) 297 win32file.SetEndOfFile(self.handle)
298 except pywintypes.error, err: 298 except pywintypes.error, err:
299 raise WinIOError(err) 299 raise WinIOError(err)
300 300
301 getuser_fallback = win32api.GetUserName 301 getuser_fallback = win32api.GetUserName
302
303 def set_signal_handler():
304 """Register a termination handler for console events including
305 CTRL+C. python signal handlers do not work well with socket
306 operations.
307 """
308 def handler(event):
309 win32process.ExitProcess(1)
310 win32api.SetConsoleCtrlHandler(handler)