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
import time
import timeout_decorator
@timeout_decorator.timeout(5, use_signals=False)
def mytest():
print("Start")
for i in range(1, 10):
time.sleep(1)
print("%d seconds have passed" % i)
if __name__ == '__main__':
mytest()
I receive:
Traceback (most recent call last):
File "C:/Users/Will/PycharmProjects/tests/timeout.py", line 15, in <module>
mytest()
File "C:\Users\Will\AppData\Local\Programs\Python\Python36\lib\site-packages\timeout_decorator\timeout_decorator.py", line 91, in new_function
return timeout_wrapper(*args, **kwargs)
File "C:\Users\Will\AppData\Local\Programs\Python\Python36\lib\site-packages\timeout_decorator\timeout_decorator.py", line 146, in __call__
self.__process.start()
File "C:\Users\Will\AppData\Local\Programs\Python\Python36\lib\multiprocessing\process.py", line 105, in start
self._popen = self._Popen(self)
File "C:\Users\Will\AppData\Local\Programs\Python\Python36\lib\multiprocessing\context.py", line 223, in _Popen
return _default_context.get_context().Process._Popen(process_obj)
File "C:\Users\Will\AppData\Local\Programs\Python\Python36\lib\multiprocessing\context.py", line 322, in _Popen
return Popen(process_obj)
File "C:\Users\Will\AppData\Local\Programs\Python\Python36\lib\multiprocessing\popen_spawn_win32.py", line 65, in __init__
reduction.dump(process_obj, to_child)
File "C:\Users\Will\AppData\Local\Programs\Python\Python36\lib\multiprocessing\reduction.py", line 60, in dump
ForkingPickler(file, protocol).dump(obj)
_pickle.PicklingError: Can't pickle <function mytest at 0x000001FACD58FC80>: it's not the same object as __main__.mytest
System info:
Windows 10
Python 3.6.3
timeout-decorator 0.4.0
The text was updated successfully, but these errors were encountered:
Using the example given:
I receive:
System info:
Windows 10
Python 3.6.3
timeout-decorator 0.4.0
The text was updated successfully, but these errors were encountered: