##// END OF EJS Templates
crecord: avoid setting non-existing SIGTSTP signal on windows (issue5512)...
Pierre-Yves David -
r31933:b2478a99 default
parent child Browse files
Show More
@@ -473,14 +473,17 b' def chunkselector(ui, headerlist, operat'
473 """
473 """
474 ui.write(_('starting interactive selection\n'))
474 ui.write(_('starting interactive selection\n'))
475 chunkselector = curseschunkselector(headerlist, ui, operation)
475 chunkselector = curseschunkselector(headerlist, ui, operation)
476 f = signal.getsignal(signal.SIGTSTP)
476 origsigtstp = sentinel = object()
477 if util.safehasattr(signal, 'SIGTSTP'):
478 origsigtstp = signal.getsignal(signal.SIGTSTP)
477 try:
479 try:
478 curses.wrapper(chunkselector.main)
480 curses.wrapper(chunkselector.main)
479 if chunkselector.initerr is not None:
481 if chunkselector.initerr is not None:
480 raise error.Abort(chunkselector.initerr)
482 raise error.Abort(chunkselector.initerr)
481 # ncurses does not restore signal handler for SIGTSTP
483 # ncurses does not restore signal handler for SIGTSTP
482 finally:
484 finally:
483 signal.signal(signal.SIGTSTP, f)
485 if origsigtstp is not sentinel:
486 signal.signal(signal.SIGTSTP, origsigtstp)
484 return chunkselector.opts
487 return chunkselector.opts
485
488
486 def testdecorator(testfn, f):
489 def testdecorator(testfn, f):
General Comments 0
You need to be logged in to leave comments. Login now