[Python-checkins] CVS: python/dist/src/Python ceval.c,2.228,2.229

Jeremy Hylton jhylton@users.sourceforge.net
Fri, 09 Feb 2001 15:23:22 -0800


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

Modified Files:
	ceval.c 
Log Message:
When calling a PyCFunction that has METH_KEYWORDS defined, don't
create an empty dictionary if it is called without keyword args.  Just
pass NULL.  

XXX I had believed that this caused weird errors, but the test suite
runs cleanly. 


Index: ceval.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/ceval.c,v
retrieving revision 2.228
retrieving revision 2.229
diff -C2 -r2.228 -r2.229
*** ceval.c	2001/02/05 17:23:16	2.228
--- ceval.c	2001/02/09 23:23:20	2.229
***************
*** 2729,2742 ****
  
  	if (flags & METH_KEYWORDS) {
- 		if (kw == NULL) {
- 			static PyObject *dict = NULL;
- 			if (dict == NULL) {
- 				dict = PyDict_New();
- 				if (dict == NULL)
- 					return NULL;
- 			}
- 			kw = dict;
- 			Py_INCREF(dict);
- 		}
  		return (*(PyCFunctionWithKeywords)meth)(self, arg, kw);
  	}
--- 2729,2732 ----