Show More
@@ -3756,7 +3756,7 def serve(ui, repo, **opts): | |||
|
3756 | 3756 | |
|
3757 | 3757 | class service(object): |
|
3758 | 3758 | def init(self): |
|
3759 |
util.set |
|
|
3759 | util.setsignalhandler() | |
|
3760 | 3760 | self.httpd = hgweb.server.create_server(ui, app) |
|
3761 | 3761 | |
|
3762 | 3762 | if opts['port'] and not ui.verbose: |
@@ -244,7 +244,7 def find_exe(command): | |||
|
244 | 244 | return executable |
|
245 | 245 | return None |
|
246 | 246 | |
|
247 |
def set |
|
|
247 | def setsignalhandler(): | |
|
248 | 248 | pass |
|
249 | 249 | |
|
250 | 250 | def statfiles(files): |
@@ -239,9 +239,9 def getuser(): | |||
|
239 | 239 | return buf.value |
|
240 | 240 | |
|
241 | 241 | _SIGNAL_HANDLER = ctypes.WINFUNCTYPE(_BOOL, _DWORD) |
|
242 |
_signal |
|
|
242 | _signalhandler = [] | |
|
243 | 243 | |
|
244 |
def set |
|
|
244 | def setsignalhandler(): | |
|
245 | 245 | '''Register a termination handler for console events including |
|
246 | 246 | CTRL+C. python signal handlers do not work well with socket |
|
247 | 247 | operations. |
@@ -249,10 +249,10 def set_signal_handler(): | |||
|
249 | 249 | def handler(event): |
|
250 | 250 | _kernel32.ExitProcess(1) |
|
251 | 251 | |
|
252 |
if _signal |
|
|
252 | if _signalhandler: | |
|
253 | 253 | return # already registered |
|
254 | 254 | h = _SIGNAL_HANDLER(handler) |
|
255 |
_signal |
|
|
255 | _signalhandler.append(h) # needed to prevent garbage collection | |
|
256 | 256 | if not _kernel32.SetConsoleCtrlHandler(h, True): |
|
257 | 257 | raise ctypes.WinError() |
|
258 | 258 |
General Comments 0
You need to be logged in to leave comments.
Login now