Author gvanrossum
Recipients brett.cannon, eric.snow, gvanrossum, ncoghlan
Date 2014-12-17.16:29:35
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
In-reply-to <>
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 <> 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 <>
> <>
> _______________________________________
Date User Action Args
2014-12-17 16:29:35gvanrossumsetrecipients: + gvanrossum, brett.cannon, ncoghlan, eric.snow
2014-12-17 16:29:35gvanrossumlinkissue23068 messages
2014-12-17 16:29:35gvanrossumcreate