From fd9b34d7a2424809a69fd0ef696474c51da175dc Mon Sep 17 00:00:00 2001 From: realraum Date: Wed, 16 Sep 2009 14:20:55 +0000 Subject: [PATCH] minor fix --- update-web-status.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/update-web-status.py b/update-web-status.py index 856d41c..0891ebc 100755 --- a/update-web-status.py +++ b/update-web-status.py @@ -119,14 +119,14 @@ def popenTimeout2(cmd, pinput, returncode_ok=[0], ptimeout=21): try: sppoo = subprocess.Popen(cmd, stdin=subprocess.PIPE, shell=True) if sys.hexversion >= 0x020600F0: - old_shandler = signal.signal(signal.ALARM,lambda sn,sf: sppoo.kill()) + old_shandler = signal.signal(signal.SIGALRM,lambda sn,sf: sppoo.kill()) else: - old_shandler = signal.signal(signal.ALARM,lambda sn,sf: os.system("kill -9 %d" % sppoo.pid)) + old_shandler = signal.signal(signal.SIGALRM,lambda sn,sf: os.system("kill -9 %d" % sppoo.pid)) signal.alarm(ptimeout) #schedule alarm sppoo.communicate(input=pinput) sppoo.wait() signal.alarm(0) #disable pending alarms - signal.signal(signal.ALARM, old_shandler) + signal.signal(signal.SIGALRM, old_shandler) logging.debug("popenTimeout2: subprocess %d finished, returncode: %d" % (sppoo.pid,sppoo.returncode)) if sppoo.returncode < 0: logging.error("popenTimeout2: subprocess took too long (>%ds) and pid %d was killed" % (ptimeout,sppoo.pid)) @@ -134,7 +134,7 @@ def popenTimeout2(cmd, pinput, returncode_ok=[0], ptimeout=21): except Exception, e: logging.error("popenTimeout2: "+str(e)) try: - signal.signal(signal.ALARM, old_shandler) + signal.signal(signal.SIGALRM, old_shandler) except: pass return False -- 1.7.10.4