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

Steven Majewski sdm7g@Virginia.EDU
Fri, 18 Jan 2002 18:53:32 -0500 (EST)


On Sat, 19 Jan 2002, Jack Jansen wrote:

> > Looks like I need to insert a call to NSLinkEditError to
> > get the specific error info.
> >
> If you get a better exception could you post a patch?

Courtesy of Guido, the bug that I was hitting was:
http://sourceforge.net/tracker/?group_id=5470&atid=105470&func=detail&aid=498915


But below is that change that gave me the following more detailed
error string:

>>> import pyobjc
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
ImportError: dyld: /usr/local/src/Python-2.2/python.exe Undefined symbols:
_PyObject_DelItemString
Failure linking new module
>>>


-- Steve


*** dynload_next.c.0	Fri Jan 18 13:50:06 2002
--- dynload_next.c	Fri Jan 18 14:08:13 2002
***************
*** 150,157 ****
  		if (errString == NULL) {
  			newModule = NSLinkModule(image, pathname,
  				NSLINKMODULE_OPTION_BINDNOW|NSLINKMODULE_OPTION_RETURN_ON_ERROR);
! 			if (!newModule)
! 				errString = "Failure linking new module";
  		}
  		if (errString != NULL) {
  			PyErr_SetString(PyExc_ImportError, errString);
--- 150,164 ----
  		if (errString == NULL) {
  			newModule = NSLinkModule(image, pathname,
  				NSLINKMODULE_OPTION_BINDNOW|NSLINKMODULE_OPTION_RETURN_ON_ERROR);
! 			if (!newModule) {  // sdm7g
! 			  int errNo;
! 			  char *fileName, *moreErrorStr;
! 			  NSLinkEditErrors c;
! 			  errString = "Failure linking new module";
! 			  NSLinkEditError( &c, &errNo, &fileName, &moreErrorStr );
! 			  errString = strcat( fileName, errString );
! 			  errString = strcat( moreErrorStr, errString );
! 			} // sdm7g
  		}
  		if (errString != NULL) {
  			PyErr_SetString(PyExc_ImportError, errString);