Jeg innbiller meg at jeg har fikset problemet med C-c.

This commit is contained in:
Øystein Ingmar Skartsæterhagen 2010-10-03 15:34:11 +00:00
parent 83d18fb309
commit 4b686894e4
1 changed files with 2 additions and 2 deletions

View File

@ -123,9 +123,9 @@ def less(string):
'''
# If we don't ignore SIGINT while running the `less` process,
# it will become a zombie when someone presses C-c.
signal.signal(signal.SIGINT, signal.SIG_IGN)
int_handler = signal.signal(signal.SIGINT, signal.SIG_IGN)
env = dict(os.environ)
env['LESSSECURE'] = '1'
proc = subprocess.Popen('less', env=env, stdin=subprocess.PIPE)
proc.communicate(safe_str(string))
signal.signal(signal.SIGINT, signal.SIG_DFL)
signal.signal(signal.SIGINT, int_handler)