[Pythonmac-SIG] pyobjc.so [was: Knock me over with a spoon!]

Steven Majewski sdm7g@Virginia.EDU
Fri, 18 Jan 2002 13:29:35 -0500 (EST)


On Fri, 18 Jan 2002, Steven Majewski wrote:

> Grab and unpack:
> 	<http://prdownloads.sourceforge.net/pyobjc/pyobjc-0.6.tar.gz>


BTW: There is also a prebuilt pyobjc.so that works for 2.1.x
at sourceforge:

	<http://prdownloads.sourceforge.net/pyobjc/pyobjc.so>

>
> in _PyImport_LoadDynamicModule,
>     in _PyImport_GetDynLoadFunc,
> after:
> 	rc = NSCreateObjectFileImageFromFile(pathname, &image);
>
> rc == NSObjectImageFileSuccess
>
> but when it hits NSLinkModule, it seems to be returning 0x0:
>
> 150                     if (errString == NULL) {
> 151                             newModule = NSLinkModule(image, pathname,
> 152                                     NSLINKMODULE_OPTION_BINDNOW|NSLINKMODULE_OPTION_RETURN_ON_ERROR);
> 153                             if (!newModule)
> 154                                     errString = "Failure linking new module";
> 155                     }
>

I keep forgetting where to find the docs for those routines --
'man -k' never seems to find it for me. ( It's 'man NSModule', BTW.)

       NSLINKMODULE_OPTION_RETURN_ON_ERROR
              With this option if errors occur while binding this
              module it  is  automaticly  unloaded  and  NULL  is
              returned  as  the  module handle.  To get the error
              information for the module that failed to load  the
              routine  NSLinkEditError  is then used.  It has the
              same parameters as the link edit error handler (see
              below)  except  all  the parameters are pointers in
              which the information is returned indirectly.


Looks like I need to insert a call to NSLinkEditError to
get the specific error info.

-- Steve