[Python-checkins] python/dist/src/Mac/Modules/qd _Qdmodule.c,1.16,1.17 qdsupport.py,1.42,1.43

jackjansen@users.sourceforge.net jackjansen@users.sourceforge.net
2003年3月21日 08:42:39 -0800


Update of /cvsroot/python/python/dist/src/Mac/Modules/qd
In directory sc8-pr-cvs1:/tmp/cvs-serv13171
Modified Files:
	_Qdmodule.c qdsupport.py 
Log Message:
Give a better error message when a string of the wrong size is
passed to RawBitMap.
Index: _Qdmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Modules/qd/_Qdmodule.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** _Qdmodule.c	23 Dec 2002 23:16:23 -0000	1.16
--- _Qdmodule.c	21 Mar 2003 16:42:36 -0000	1.17
***************
*** 15,21 ****
 /* Macro to test whether a weak-loaded CFM function exists */
 #define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\
! 	PyErr_SetString(PyExc_NotImplementedError, \
! 	"Not available in this shared library/OS version"); \
! 	return NULL; \
 }} while(0)
 
--- 15,21 ----
 /* Macro to test whether a weak-loaded CFM function exists */
 #define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\
! PyErr_SetString(PyExc_NotImplementedError, \
! "Not available in this shared library/OS version"); \
! return NULL; \
 }} while(0)
 
***************
*** 6259,6263 ****
 		return NULL;
 	if ( PyString_Size(source) != sizeof(BitMap) && PyString_Size(source) != sizeof(PixMap) ) {
! 		PyErr_BadArgument();
 		return NULL;
 	}
--- 6259,6265 ----
 		return NULL;
 	if ( PyString_Size(source) != sizeof(BitMap) && PyString_Size(source) != sizeof(PixMap) ) {
! 		PyErr_Format(PyExc_TypeError, 
! 			"Argument size was %d, should be %d (sizeof BitMap) or %d (sizeof PixMap)", 
! 			PyString_Size(source), sizeof(BitMap), sizeof(PixMap));
 		return NULL;
 	}
Index: qdsupport.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Modules/qd/qdsupport.py,v
retrieving revision 1.42
retrieving revision 1.43
diff -C2 -d -r1.42 -r1.43
*** qdsupport.py	12 Dec 2002 10:31:52 -0000	1.42
--- qdsupport.py	21 Mar 2003 16:42:36 -0000	1.43
***************
*** 421,425 ****
 	return NULL;
 if ( PyString_Size(source) != sizeof(BitMap) && PyString_Size(source) != sizeof(PixMap) ) {
! 	PyErr_BadArgument();
 	return NULL;
 }
--- 421,427 ----
 	return NULL;
 if ( PyString_Size(source) != sizeof(BitMap) && PyString_Size(source) != sizeof(PixMap) ) {
! 	PyErr_Format(PyExc_TypeError, 
! 		"Argument size was %d, should be %d (sizeof BitMap) or %d (sizeof PixMap)", 
! 		PyString_Size(source), sizeof(BitMap), sizeof(PixMap));
 	return NULL;
 }

AltStyle によって変換されたページ (->オリジナル) /