python3: signal.signal/singal.alarm not working as expected

2010-08-02 Thread Alan
Hi there, I have this example code to illustrate a problem I am having with python3. It works fine with python 2.6 and 2.7 but does not with python 3.1. Please, can someone tell me why or how to fix this example? from __future__ import print_function import os, subprocess, signal def signal_ha

python3: signal.signal/singal.alarm

2010-07-15 Thread Alan
Hi there, I have this, say timeTol = 5 (5 seconds) and 'cmd' takes minutes to execute : import subprocess as sub ... p = sub.Popen(cmd, shell=True, stderr = sub.STDOUT, stdout = sub.PIPE) pid = p.pid signal.signal(signal.SIGALRM, sig