Author eric.snow
Recipients brett.cannon, eric.snow, gvanrossum, ncoghlan
Date 2014-12-17.05:59:40
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1418795981.03.0.234284187244.issue23068@psf.upfronthosting.co.za>
In-reply-to
Content
Keep in mind that the global import lock is only held long enough to create a module-level lock.  The cache of module locks is found at line 166 of Lib/importlib/_bootstrap.py and the code related to module-level locking follows.  So unfortunately it won't be as simple as just getting the thread info from the global import lock.

Regardless, would it be useful to expose a function in importlib.util that indicates whether or not the current thread is importing a module (actually the names of the modules it is importing)?  Something like that would probably check both the global import lock and the module level locks, but make it unnecessary to expose the locks directly.  Given the situation with module-level locks I image such a helper is going to be desirable.
History
Date User Action Args
2014-12-17 05:59:41eric.snowsetrecipients: + eric.snow, gvanrossum, brett.cannon, ncoghlan
2014-12-17 05:59:41eric.snowsetmessageid: <1418795981.03.0.234284187244.issue23068@psf.upfronthosting.co.za>
2014-12-17 05:59:40eric.snowlinkissue23068 messages
2014-12-17 05:59:40eric.snowcreate