[Python-checkins] CVS: python/dist/src/Modules timemodule.c,2.79,2.80

Jeremy Hylton jhylton@cnri.reston.va.us
Tue, 14 Mar 2000 16:17:24 -0500


Update of /projects/cvsroot/python/dist/src/Modules
In directory goon.cnri.reston.va.us:/home/jhylton/python/src/Modules

Modified Files:
	timemodule.c 
Log Message:
Fix bogus error reporting on strptime: let PyArg_ParseTuple set exception.
Also, wrap long line.


Index: timemodule.c
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Modules/timemodule.c,v
retrieving revision 2.79
retrieving revision 2.80
diff -C2 -r2.79 -r2.80
*** timemodule.c	2000/02/29 13:59:24	2.79
--- timemodule.c	2000/03/14 21:17:16	2.80
***************
*** 374,378 ****
  	memset((ANY *) &buf, '\0', sizeof(buf));
  
! 	if (!PyArg_ParseTuple(args, "sO:strftime", &fmt, &tup) || !gettmarg(tup, &buf))
  		return NULL;
  	fmtlen = strlen(fmt);
--- 374,379 ----
  	memset((ANY *) &buf, '\0', sizeof(buf));
  
! 	if (!PyArg_ParseTuple(args, "sO:strftime", &fmt, &tup) 
! 	    || !gettmarg(tup, &buf))
  		return NULL;
  	fmtlen = strlen(fmt);
***************
*** 422,429 ****
  	char *s;
  
! 	if (!PyArg_ParseTuple(args, "s|s:strptime", &buf, &fmt)) {
! 		PyErr_SetString(PyExc_ValueError, "invalid argument");
! 		return NULL;
! 	}
  	memset((ANY *) &tm, '\0', sizeof(tm));
  	s = strptime(buf, fmt, &tm);
--- 423,428 ----
  	char *s;
  
! 	if (!PyArg_ParseTuple(args, "s|s:strptime", &buf, &fmt))
! 	        return NULL;
  	memset((ANY *) &tm, '\0', sizeof(tm));
  	s = strptime(buf, fmt, &tm);