[Python-Dev] Preventing 1.5 extensions crashing under 1.6/2.0 Python

Guido van Rossum guido@beopen.com
Sun, 09 Jul 2000 16:52:13 -0500

> I read in the archives the problem with import of a 1.5 extension
> into newer Python release crashing say new Python.
> A solution that works is to use a new naming scheme for the
> initialisation entry point. Currently it is "init" + module-name
> with "_d" appended if it is debug image.
> Change "init" to "init16", "init20" and you can import the old
> 1.5 linked extension without a crash, you get an error reported
> instead.

Nice idea...  Unfortunately it means that every module must be
changed.  If we want to do this, we'd best introduce a macro!
E.g. (untested):

  #define Py_INIT(modname) DL_EXPORT(void) init20##modname()

--Guido van Rossum (home page: http://dinsdale.python.org/~guido/)