[Python-checkins] python/dist/src/Modules datetimemodule.c,1.49,1.50

tim_one@users.sourceforge.net tim_one@users.sourceforge.net
Thu, 30 Jan 2003 17:37:38 -0800


Update of /cvsroot/python/python/dist/src/Modules
In directory sc8-pr-cvs1:/tmp/cvs-serv30063/Modules

Modified Files:
	datetimemodule.c 
Log Message:
Backward branches are disgusting, at least when a forward branch
is just as easy.


Index: datetimemodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/datetimemodule.c,v
retrieving revision 1.49
retrieving revision 1.50
diff -C2 -d -r1.49 -r1.50
*** datetimemodule.c	30 Jan 2003 22:06:21 -0000	1.49
--- datetimemodule.c	31 Jan 2003 01:37:35 -0000	1.50
***************
*** 2549,2558 ****
  	unsigned char *pdata;
  
! 	if (!PyTuple_Check(arg) || PyTuple_GET_SIZE(arg) != 1) {
!   error:
! 		PyErr_SetString(PyExc_TypeError,
! 				"bad argument to date.__setstate__");
! 		return NULL;
! 	}
  	state = PyTuple_GET_ITEM(arg, 0);
  	if (!PyString_Check(state))
--- 2549,2554 ----
  	unsigned char *pdata;
  
! 	if (!PyTuple_Check(arg) || PyTuple_GET_SIZE(arg) != 1)
! 		goto error;
  	state = PyTuple_GET_ITEM(arg, 0);
  	if (!PyString_Check(state))
***************
*** 2569,2572 ****
--- 2565,2572 ----
  	Py_INCREF(Py_None);
  	return Py_None;
+  error:
+ 	PyErr_SetString(PyExc_TypeError,
+ 			"bad argument to date.__setstate__");
+ 	return NULL;
  }