[Python-checkins] python/dist/src/Modules cPickle.c,2.148,2.149

tismer at users.sourceforge.net tismer at users.sourceforge.net
Thu Feb 26 11:21:47 EST 2004


Update of /cvsroot/python/python/dist/src/Modules
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28644/Modules
Modified Files:
	cPickle.c 
Log Message:
made cPickle fall back to the copy_reg/reduce protocol,
if a function cannot be stored as global.
This is for compatibility with pickle.py .
Index: cPickle.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/cPickle.c,v
retrieving revision 2.148
retrieving revision 2.149
diff -C2 -d -r2.148 -r2.149
*** cPickle.c	12 Oct 2003 19:09:36 -0000	2.148
--- cPickle.c	26 Feb 2004 16:21:45 -0000	2.149
***************
*** 2419,2422 ****
--- 2419,2427 ----
 		if (type == &PyFunction_Type) {
 			res = save_global(self, args, NULL);
+ 			if (res && PyErr_ExceptionMatches(PickleError)) {
+ 				/* fall back to reduce */
+ 				PyErr_Clear();
+ 				break;
+ 			}
 			goto finally;
 		}


More information about the Python-checkins mailing list

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