Stefan Behnel <stefan...@behnel.de> added the comment:

FYI, I've updated Cython's module import checks to include an interpreter 
check. This (multi-file) test shows the new behaviour, which is to raise an 
ImportError on module creation when it detects a different interpreter than 
during the initial import:

https://github.com/cython/cython/blob/master/tests/run/reimport_from_subinterpreter.srctree

The checks are implemented here (and called a bit further down in the module 
create function):
https://github.com/cython/cython/blob/4ce754271ff4cfbd8df2b278e812154fb1b02319/Cython/Utility/ModuleSetupCode.c#L909-L932

I also added a test that should match the problem discussed here, which makes 
what I described appear as a viable solution (or work-around):

https://github.com/cython/cython/blob/master/tests/run/reimport_from_package.srctree

----------

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

Reply via email to