Antoine Pitrou added the comment: After a bit of investigation, it turns out the test is probably too strict. The deadlock avoidance logic in importlib._bootstrap is indeed conservative: if you take a look at _ModuleLock.acquire(), _blocking_on[tid] is set even while other threads may run, because the internal lock is not always taken. Therefore, if there's a potential deadlock between several threads, there are situations where DeadlockError will be raised in two threads, not only one.
(IMHO it would complicate the code too much to make deadlock avoidance less conservative, without bringing anything in terms of additional functionality) See attached patch. ---------- keywords: +patch Added file: http://bugs.python.org/file27025/relax_deadlock_test.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue15794> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com