[issue12410] Create a new helper function that enable to test that an operation don't hang more than a given timeout.

STINNER Victor report at bugs.python.org
Sun Jun 26 00:46:28 CEST 2011


STINNER Victor <victor.stinner at haypocalc.com> added the comment:

Oh, there is another possible implementation: use a subprocess. But if the timeout is implemented using a subprocess, the syntax cannot be:

with timeout(5):
   do_something()

It should be something like:


timeout(5, """if 1:
   import os, sys
   ...
   do_something()
   ...
   sys.exit(0)
""")

Some tests are already doing that manually.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue12410>
_______________________________________


More information about the Python-bugs-list mailing list