Nick Coghlan added the comment:

Perhaps an API like "importlib.util.locks_held()" that returns a list of module 
names?

We'd then just iterate over the _module_locks() dictionary, looking for locks 
where the owner matched the current thread id (alternatively, if speed was 
critical for Guido's use case, add a separate reverse mapping from tid to locks 
held)

(Unless I've missed something, we don't run user code with the global import 
lock held any more)

----------

_______________________________________
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

Reply via email to