Brett Cannon added the comment:

All cases but signal can be fixed by importlib._bootstrap._setup() by simply 
iterating over sys.modules and setting __loader__. Nice and simple. Thanks, 
abstraction!

The problem is signal who gives the finger to abstraction. That module gets 
imported directly by C code which cheats by calling PyInit_signal() directly 
and then calling _PyImport_FixupBuiltin(). I tried setting __loader__ in there 
but I'm actually triggering a segfault in PyErr_Format()! This is probably 
because I/O streams are not set up yet at this point in interpreter startup. 
Anyway, I'm trying to simply not have the code cheat and instead just import 
the signal module through the proper abstractions.

----------

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

Reply via email to