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

Mark Hammond mhammond@skippinet.com.au
Sun, 16 Jul 2000 21:42:36 -0400

[Gordon, responding to Barry]

> In an ideal world, I rather like #5 (stubs), but I vote for #4
> (version number in the extension module name) or #6 (get a
> life).

#6 sounds good.  But as I'm still experiencing a life in Orlando (with a
couple of teenage girls dragging a couple of grumpy old Dads around
Universal studios), I'll throw something in :-)

Barry's idea sounds reasonable - although a little more elaborate than is

Barry calls for all extension authors to modify their extension code.  I
can't see a simple solution that avoids this. However, the solution seems a
little over-elaborate.

If we are asking them to change their code, can we investigate whether
asking them to insert a simple:

if (!Py_IsInitialized())
  Py_FatalError("Bad Python version"); /* Never returns */

works OK?  I believe it will, as long as Python's fatal error handler
doesnt make thread-state assumptions.