Robin Becker <ro...@reportlab.com> writes: > A user reported an infinite loop in reportlab. I determined a possible > cause and fix and would like to test for absence of the loop. Is there > any way to check for presence/absence of an infinite loop in python? I > imagine we could do something like call an external process and see if > it takes too long, but that seems a bit flaky.
On some systems (among them Linux), you can limit (some) resources used by a process, among them the CPU time. If a process exceeds the limit, it is killed by the operating system. The "bash" makes this available with the "ulimit" command. On Linux, there is also the "timeout" command (with a similar effect). -- https://mail.python.org/mailman/listinfo/python-list