Nick Coghlan <ncogh...@gmail.com> added the comment:

The main idea that comes to mind is to cache a reference to 
`_frozen_importlib._module_locks` in the interpreter state, and do a key lookup 
in there (since any in-progress import should have a lock allocated to it).

That would be a separate performance issue though - for this issue, we're on an 
error handling path, so the speed with which the error gets reported isn't 
critical (although it does technically slow down try/except import fallback 
chains).

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue33237>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to