You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I can't seem to get the example code working from your Usage section. Code:
`import time
import timeout_decorator
@timeout_decorator.timeout(5)
def mytest():
print "Start"
for i in range(1,10):
time.sleep(1)
print "%d seconds have passed" % i
if name == 'main':
mytest()
`
Error:
me$ python2.7 tod.py Start 1 seconds have passed 2 seconds have passed 3 seconds have passed 4 seconds have passed Traceback (most recent call last): File "tod.py", line 13, in <module> mytest() File "/Users/me/anaconda2/lib/python2.7/site-packages/timeout_decorator/timeout_decorator.py", line 69, in new_function return function(*args, **kwargs) File "tod.py", line 9, in mytest time.sleep(1) File "/Users/me/anaconda2/lib/python2.7/site-packages/timeout_decorator/timeout_decorator.py", line 60, in handler raise TimeoutError() timeout_decorator.timeout_decorator.TimeoutError: u'Timed Out'
The text was updated successfully, but these errors were encountered:
I can't seem to get the example code working from your Usage section. Code:
`import time
import timeout_decorator
@timeout_decorator.timeout(5)
def mytest():
print "Start"
for i in range(1,10):
time.sleep(1)
print "%d seconds have passed" % i
if name == 'main':
mytest()
`
Error:
me$ python2.7 tod.py Start 1 seconds have passed 2 seconds have passed 3 seconds have passed 4 seconds have passed Traceback (most recent call last): File "tod.py", line 13, in <module> mytest() File "/Users/me/anaconda2/lib/python2.7/site-packages/timeout_decorator/timeout_decorator.py", line 69, in new_function return function(*args, **kwargs) File "tod.py", line 9, in mytest time.sleep(1) File "/Users/me/anaconda2/lib/python2.7/site-packages/timeout_decorator/timeout_decorator.py", line 60, in handler raise TimeoutError() timeout_decorator.timeout_decorator.TimeoutError: u'Timed Out'
The text was updated successfully, but these errors were encountered: