Open itamarst opened 7 years ago
Unfortunately the real code is complex and I'm having trouble creating a reproducer, but updated my description above with plausible theory.
Thanks for the feedback. I have seen this before too during development of some modules in future.backports
, but it was hard to reproduce for me too. I ended up removing the use of hooks
. It may be time to mark the hooks
interface as deprecated.
Meanwhile, please let us know if you succeed in reproducing it reliably.
This code made
from mymodule import *
fail. That is, it runs, but nothing gets imported into the module running that, as ifmymodule
is empty. Later calls tofrom mymodule import *
, e.g. in a debuger, do work. My guess is the issue is something to do with copying and then re-inserting stuff fromsys.modules
that theinstall_hooks
-related code does; probably modules are being copied at the wrong time, when they're still half-empty or something.