Cross-version extension modules?

Pieter Claerhout Pieter.Claerhout at Creo.com
Wed Jan 28 05:44:30 EST 2004


Normally, it doesn't change between micro versions.

pieter

Creo
pieter claerhout | product support prinergy | tel: +32 2 352 2511 |
pieter.claerhout at creo.com | www.creo.com

IMAGINE CREATE BELIEVE(tm)


-----Original Message-----
From: Peter Astrand [mailto:peter at cendio.se] 
Sent: 28 January 2004 11:43
To: python-list at python.org
Subject: RE: Cross-version extension modules?


On Wed, 28 Jan 2004, Pieter Claerhout wrote:

> extension modules in Python are always linked to a specific version of
> Python. You might perform some tricks with writing a pure Python module
> about your extension that, based on the version of the python interpreter,
> loads a different version of your extension. This is e.g. the way the
Python
> drivers for SapDB work.

Thanks. Is PYTHON_API_VERSION guaranteed to increase only when the Python 
major or minor version increases, or can it change between micro versions 
as well?


/Peter
> -----Original Message-----
> From: Peter Astrand [mailto:peter at cendio.se] 
> Sent: 28 January 2004 10:40
> To: python-list at python.org
> Subject: Cross-version extension modules?
> 
> 
> 
> If I build a extension module with Python 2.2 and then loads it with 2.3, 
> I get:
> 
> RuntimeWarning: Python C API version mismatch for module _foo: This
> Python has API version 1012, module _foo has version 1011.
> 
> How fatal is this? Is it safe to use the module anyway? If not, is it
> possible to build the module differently, so that it actually is safe to
> use it with different versions of Python?
> 
> 

-- 
Peter Åstrand		www.thinlinc.com
Cendio			www.cendio.se
Teknikringen 3		Phone: +46-13-21 46 00
583 30 Linköping


-- 
http://mail.python.org/mailman/listinfo/python-list




More information about the Python-list mailing list