[Python-checkins] python/dist/src/Python dynload_next.c,2.10,2.10.6.1

jackjansen@users.sourceforge.net jackjansen@users.sourceforge.net
Tue, 25 Feb 2003 06:20:49 -0800


Update of /cvsroot/python/python/dist/src/Python
In directory sc8-pr-cvs1:/tmp/cvs-serv25398

Modified Files:
      Tag: release22-maint
	dynload_next.c 
Log Message:
Partial backport of 2.11: better error messages on import failures.
Fixes #652590.


Index: dynload_next.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/dynload_next.c,v
retrieving revision 2.10
retrieving revision 2.10.6.1
diff -C2 -d -r2.10 -r2.10.6.1
*** dynload_next.c	6 Dec 2001 22:58:56 -0000	2.10
--- dynload_next.c	25 Feb 2003 14:20:44 -0000	2.10.6.1
***************
*** 121,124 ****
--- 121,125 ----
  		NSSymbol theSym;
  		const char *errString;
+ 		char errBuf[512];
  	
  		if (NSIsSymbolNameDefined(funcname)) {
***************
*** 151,156 ****
  			newModule = NSLinkModule(image, pathname,
  				NSLINKMODULE_OPTION_BINDNOW|NSLINKMODULE_OPTION_RETURN_ON_ERROR);
! 			if (!newModule)
! 				errString = "Failure linking new module";
  		}
  		if (errString != NULL) {
--- 152,164 ----
  			newModule = NSLinkModule(image, pathname,
  				NSLINKMODULE_OPTION_BINDNOW|NSLINKMODULE_OPTION_RETURN_ON_ERROR);
! 			if (newModule == NULL) {
! 				int errNo;
! 				char *fileName, *moreErrorStr;
! 				NSLinkEditErrors c;
! 				NSLinkEditError( &c, &errNo, &fileName, &moreErrorStr );
! 				PyOS_snprintf(errBuf, 512, "Failure linking new module: %s: %s", 
! 						fileName, moreErrorStr);
! 				errString = errBuf;
! 			}
  		}
  		if (errString != NULL) {