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 <CAP7+vJ+iJQxhgLC-tedOAuxqu87ZrZR3S8xWU1chZhWBv6Tb7w@mail.gmail.com>
In-reply-to <CALFfu7B8v-xxphZmkDcsDsyL-0bzkebREeBA5M0iK235s8tZMA@mail.gmail.com>
Content
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 <report@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 <report@bugs.python.org>
> <http://bugs.python.org/issue23068>
> _______________________________________
>
History
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