[Python-checkins] CVS: python/dist/src/Mac/Modules/qd _Qdmodule.c,1.7,1.7.4.1 qdsupport.py,1.37,1.37.4.1

Jack Jansen jackjansen@users.sourceforge.net
Mon, 25 Mar 2002 04:20:45 -0800


Update of /cvsroot/python/python/dist/src/Mac/Modules/qd
In directory usw-pr-cvs1:/tmp/cvs-serv21711

Modified Files:
      Tag: release22-maint
	_Qdmodule.c qdsupport.py 
Log Message:
Backport of _Qdmodule.c 1.8, qdsupport.py 1.38:
Weaklink most toolbox modules, improving backward compatibility. Modules will no longer fail to load if a single routine is missing on the curent OS version, in stead calling the missing routine will raise an exception.

Should finally fix 531398. 2.2.1 candidate.

Also blacklisted some constants with definitions that were not Python-compatible.



Index: _Qdmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Modules/qd/_Qdmodule.c,v
retrieving revision 1.7
retrieving revision 1.7.4.1
diff -C2 -d -r1.7 -r1.7.4.1
*** _Qdmodule.c	18 Dec 2001 15:37:03 -0000	1.7
--- _Qdmodule.c	25 Mar 2002 12:20:42 -0000	1.7.4.1
***************
*** 658,661 ****
--- 658,664 ----
  	PyObject *_res = NULL;
  	GrafPtr port;
+ #ifndef MacSetPort
+ 	PyMac_PRECHECK(MacSetPort);
+ #endif
  	if (!PyArg_ParseTuple(_args, "O&",
  	                      GrafObj_Convert, &port))
***************
*** 671,674 ****
[...3078 lines suppressed...]
***************
*** 5442,5445 ****
--- 6369,6375 ----
  	Point pt;
  	Rect r;
+ #ifndef PtInRect
+ 	PyMac_PRECHECK(PtInRect);
+ #endif
  	if (!PyArg_ParseTuple(_args, "O&O&",
  	                      PyMac_GetPoint, &pt,
***************
*** 5460,5463 ****
--- 6390,6396 ----
  	short firstByte;
  	short byteCount;
+ #ifndef DrawText
+ 	PyMac_PRECHECK(DrawText);
+ #endif
  	if (!PyArg_ParseTuple(_args, "s#hh",
  	                      &textBuf__in__, &textBuf__in_len__,

Index: qdsupport.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Modules/qd/qdsupport.py,v
retrieving revision 1.37
retrieving revision 1.37.4.1
diff -C2 -d -r1.37 -r1.37.4.1
*** qdsupport.py	18 Dec 2001 15:39:23 -0000	1.37
--- qdsupport.py	25 Mar 2002 12:20:43 -0000	1.37.4.1
***************
*** 549,554 ****
  
  # Create the generator classes used to populate the lists
! Function = OSErrFunctionGenerator
! Method = OSErrMethodGenerator
  
  # Create and populate the lists
--- 549,554 ----
  
  # Create the generator classes used to populate the lists
! Function = OSErrWeakLinkFunctionGenerator
! Method = OSErrWeakLinkMethodGenerator
  
  # Create and populate the lists