This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author scoder
Recipients Arfrever, Dormouse759, amaury.forgeotdarc, asvetlov, brett.cannon, eric.snow, eudoxos, gregory.p.smith, ncoghlan, petr.viktorin, pitrou, r.david.murray, scoder, twouters, vstinner
Date 2018-08-25.16:36:18
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1535214978.11.0.56676864532.issue32973@psf.upfronthosting.co.za>
In-reply-to
Content
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
History
Date User Action Args
2018-08-25 16:36:18scodersetrecipients: + scoder, twouters, brett.cannon, gregory.p.smith, amaury.forgeotdarc, ncoghlan, pitrou, vstinner, Arfrever, r.david.murray, petr.viktorin, asvetlov, eric.snow, eudoxos, Dormouse759
2018-08-25 16:36:18scodersetmessageid: <1535214978.11.0.56676864532.issue32973@psf.upfronthosting.co.za>
2018-08-25 16:36:18scoderlinkissue32973 messages
2018-08-25 16:36:18scodercreate