[Pythonmac-SIG] Re: Extension module binary compatibility

John Ehresman jpe@wingide.com
20 Feb 2003 18:15:16 -0500


On Thu, 2003-02-20 at 17:48, Bob Ippolito wrote:
> As I said, leave any other binary distribution of python modules to the 
> maintainers of the distribution... but if you MUST, you can do 
> something like this:
> ...

Thanks, the example was helpful.  Let me just suggest that this is what
I, as a distributor of binary modules, would like to see for 2.3:
  if sys.platform == 'darwin' and sys.osx_framework != None:
    if sys.osx_framework == 'Python':
      import module_for_framework
      module = module_for_framework
    else:
      # Ask user to contact us
  else:
    import module

The name osx_framework can be changed, but what I'm looking for is a way
to determine if a framework is used and what it's name is that doesn't
depend on pathname conventions.  Otherwise, it breaks when a no
framework build is put in /home/username/i-like-weird-names.framework 
Admittedly this is a contrived example, but why not make the framework
the executable was compiled with available in the executable?

John