Message147920
... and the module init function could create and register a different module first, and ...
Well, yes, it's a best effort thing. It's rather unlikely that the GIL would get released in between the call to the init function and the creation of the module within that function, but sure, I don't see a reason why it could not happen.
However, it can't happen in moduleobject.c between the NULL check and the setting of the __file__ attribute, so that is safe enough to not trigger crashes.
And even if the wrong __file__ value is set during the run of the init function, it will still get overwritten (and thus fixed) afterwards. So my intuition is that code that relies on this new feature will simply have to make sure the module object creation is the first thing it does, and code that does not rely on it, well, does not rely on it. |
|
Date |
User |
Action |
Args |
2011-11-18 20:00:10 | scoder | set | recipients:
+ scoder, loewis, amaury.forgeotdarc |
2011-11-18 20:00:10 | scoder | set | messageid: <1321646410.57.0.567479702204.issue13429@psf.upfronthosting.co.za> |
2011-11-18 20:00:09 | scoder | link | issue13429 messages |
2011-11-18 20:00:09 | scoder | create | |
|