Guido van Rossum added the comment: Oh. I'd forgotten the PY3 situation is completely different from the PY2 situation. We're still stuck here in PY2 land where there's just the one import lock. I guess not even ctypes can help us find out whether the current thread is holding the import lock (which is the condition we're trying to test for so we can print the warning). Our current hack is to check lock_held() and if it is held wait for up to 5 second (in 10 msec increments) to see if it goes away -- if it doesn't go away it would seem we are holding it in the current thread and then we fail with a rude assert. If it does go away within that time we assume some other thread was doing some lazy importing and we hope they'll be done soon because the whole world is waiting for them.
On Wed, Dec 17, 2014 at 6:36 AM, Eric Snow <rep...@bugs.python.org> wrote: > > > Eric Snow added the comment: > > > (Unless I've missed something, we don't run user code with the global > import lock held any more) > > Ah. You are correct. > > ---------- > > _______________________________________ > Python tracker <rep...@bugs.python.org> > <http://bugs.python.org/issue23068> > _______________________________________ > ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue23068> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com