[Python-Dev] Patch to avoid conflict with older versions of Python.
Mark Hammond
MarkH@ActiveState.com
Fri, 29 Sep 2000 12:36:11 +1100
Hi all,
I'd like some feedback on a patch assigned to me. It is designed to
prevent Python extensions built for an earlier version of Python from
crashing the new version.
I haven't actually tested the patch, but I am sure it works as advertised
(who is db31 anyway?).
My question relates more to the "style" - the patch locates the new .pyd's
address in memory, and parses through the MS PE/COFF format, locating the
import table. If then scans the import table looking for Pythonxx.dll, and
compares any found entries with the current version.
Quite clever - a definite plus is that is should work for all old and
future versions (of Python - dunno about Windows ;-) - but do we want this
sort of code in Python? Is this sort of hack, however clever, going to
some back and bite us?
Second related question: if people like it, is this feature something we
can squeeze in for 2.0?
If there are no objections to any of this, I am happy to test it and check
it in - but am not confident of doing so without some feedback.
Thanks,
Mark.