Message14599
import signal
def handle(a,b):
print "received signal"
signal.signal(signal.SIGALRM, handle)
signal.alarm(5)
name = raw_input('Please enter your name within 5
seconds: ')
waits for input forever instead of getting the signal
thrown
after 5 seconds. If you wait more than 5 seconds before
typing your name, the signal does get handled after you
finally enter your input.
The workaround of calling sys.stdin.readline() instead of
raw_input does the right thing, so something is funny about
the raw_input function.
|
|
Date |
User |
Action |
Args |
2007-08-23 14:11:01 | admin | link | issue685846 messages |
2007-08-23 14:11:01 | admin | create | |
|