Brett Cannon added the comment:

My guess is the import of package has completed but package.submodule hasn't (I 
don't know what state it would be in, but obviously before the module is 
assigned as an attribute on the package), a context switch occurs, and then the 
assignment fails due to package.submodule not being set on package yet.

I wonder if package.submodule is in sys.modules when the AttributeError is 
triggered? I don't remember when the assignment of a submodule to an attriute 
on a package occurs, but this suggests it's rather late and that's why this is 
failing. Maybe the assignment is outside of the per-module lock being released 
and that is what's causing this?

Hey, at least importing in a thread doesn't deadlock anymore like it used to. ;)

----------

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

Reply via email to