[Python-checkins] python/dist/src/Modules datetimemodule.c,1.26,1.27

tim_one@users.sourceforge.net tim_one@users.sourceforge.net
Thu, 02 Jan 2003 11:35:57 -0800


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

Modified Files:
	datetimemodule.c 
Log Message:
astimezone() internals:  if utcoffset() returns a duration, complain if
dst() returns None (instead of treating that as 0).


Index: datetimemodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/datetimemodule.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -d -r1.26 -r1.27
*** datetimemodule.c	2 Jan 2003 17:55:03 -0000	1.26
--- datetimemodule.c	2 Jan 2003 19:35:54 -0000	1.27
***************
*** 4806,4810 ****
  	if (resdst == -1 && PyErr_Occurred())
  		goto Fail;
! 	/* None and 0 dst() results are the same to us here.  Debatable. */
  	total_added_to_result = resoff - resdst - selfoff;
  	if (total_added_to_result != 0) {
--- 4806,4814 ----
  	if (resdst == -1 && PyErr_Occurred())
  		goto Fail;
! 	if (none) {
! 		PyErr_SetString(PyExc_ValueError, "astimezone(): utcoffset() "
! 		"returned a duration but dst() returned None");
! 		goto Fail;
! 	}
  	total_added_to_result = resoff - resdst - selfoff;
  	if (total_added_to_result != 0) {