[Pythonmac-SIG] Re: Extension module binary compatibility

Jack Jansen Jack.Jansen@oratrix.com
Thu, 20 Feb 2003 21:40:38 +0100


On donderdag, feb 20, 2003, at 21:16 Europe/Amsterdam, John Ehresman 
wrote:

> Hi again,
>
> I've had a chance to do further testing and it looks like an extension
> module built against the Python framework will not work with an
> non-framework interpreter if the framework directory is not present.
> This means that there probably isn't a way to support the two 2.2
> variants with a single extension module file.

This is actually living *very* dangerously: if you've a module that has 
been linked against the framework Python and you import that into a 
non-framework-python there's a good chance you'll end up with two 
interpreters in one addressspace (both a fully initialized framework 
Python and a partially initialized framework Python). The bad news is 
that I don't know how I can detect this situation:-(

> Is there a way to definitively tell if an interpreter was built with a
> framework?  Also, what happens if an interpreter is built with another
> framework name?

What I do if I need to know is to check with
if "Python.framework" in sys.prefix:
	we are in a framework Python
--
- Jack Jansen        <Jack.Jansen@oratrix.com>        
http://www.cwi.nl/~jack -
- If I can't dance I don't want to be part of your revolution -- Emma 
Goldman -