[Python-checkins] python/nondist/sandbox/datetime datetime.c,1.72,1.73 obj_datetimetz.c,1.22,1.23 obj_timetz.c,1.28,1.29

tim_one@users.sourceforge.net tim_one@users.sourceforge.net
Sat, 14 Dec 2002 19:58:30 -0800


Update of /cvsroot/python/python/nondist/sandbox/datetime
In directory sc8-pr-cvs1:/tmp/cvs-serv24169

Modified Files:
	datetime.c obj_datetimetz.c obj_timetz.c 
Log Message:
Removed useless msg argument from check_tzinfo_subclass().


Index: datetime.c
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/datetime/datetime.c,v
retrieving revision 1.72
retrieving revision 1.73
diff -C2 -d -r1.72 -r1.73
*** datetime.c	15 Dec 2002 03:55:43 -0000	1.72
--- datetime.c	15 Dec 2002 03:58:28 -0000	1.73
***************
*** 550,561 ****
   */
  static int
! check_tzinfo_subclass(PyObject *p, const char *msg)
  {
  	if (p == Py_None || PyTZInfo_Check(p))
  		return 0;
  	PyErr_Format(PyExc_TypeError,
! 		     "%s must be None or of a tzinfo subclass, "
  		     "not type '%s'",
! 		     msg, p->ob_type->tp_name);
  	return -1;
  }
--- 550,561 ----
   */
  static int
! check_tzinfo_subclass(PyObject *p)
  {
  	if (p == Py_None || PyTZInfo_Check(p))
  		return 0;
  	PyErr_Format(PyExc_TypeError,
! 		     "tzinfo argument must be None or of a tzinfo subclass, "
  		     "not type '%s'",
! 		     p->ob_type->tp_name);
  	return -1;
  }

Index: obj_datetimetz.c
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/datetime/obj_datetimetz.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -d -r1.22 -r1.23
*** obj_datetimetz.c	15 Dec 2002 03:55:43 -0000	1.22
--- obj_datetimetz.c	15 Dec 2002 03:58:28 -0000	1.23
***************
*** 64,68 ****
  		if (check_time_args(hour, minute, second, usecond) < 0)
  			return NULL;
! 		if (check_tzinfo_subclass(tzinfo, "tzinfo argument") < 0)
  			return NULL;
  		self = new_datetimetz(year, month, day,
--- 64,68 ----
  		if (check_time_args(hour, minute, second, usecond) < 0)
  			return NULL;
! 		if (check_tzinfo_subclass(tzinfo) < 0)
  			return NULL;
  		self = new_datetimetz(year, month, day,
***************
*** 85,89 ****
  	if (PyArg_ParseTupleAndKeywords(args, kw, "|O:now", keywords,
  					&tzinfo)) {
! 		if (check_tzinfo_subclass(tzinfo, "tzinfo argument") < 0)
  			return NULL;
  		self = datetime_best_possible(cls, localtime);
--- 85,89 ----
  	if (PyArg_ParseTupleAndKeywords(args, kw, "|O:now", keywords,
  					&tzinfo)) {
! 		if (check_tzinfo_subclass(tzinfo) < 0)
  			return NULL;
  		self = datetime_best_possible(cls, localtime);
***************
*** 105,109 ****
  	if (PyArg_ParseTupleAndKeywords(args, kw, "d|O:fromtimestamp",
  					keywords, &timestamp, &tzinfo)) {
! 		if (check_tzinfo_subclass(tzinfo, "tzinfo argument") < 0)
  			return NULL;
  		self = datetime_from_timestamp(cls, localtime, timestamp);
--- 105,109 ----
  	if (PyArg_ParseTupleAndKeywords(args, kw, "d|O:fromtimestamp",
  					keywords, &timestamp, &tzinfo)) {
! 		if (check_tzinfo_subclass(tzinfo) < 0)
  			return NULL;
  		self = datetime_from_timestamp(cls, localtime, timestamp);

Index: obj_timetz.c
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/datetime/obj_timetz.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -C2 -d -r1.28 -r1.29
*** obj_timetz.c	14 Dec 2002 17:42:09 -0000	1.28
--- obj_timetz.c	15 Dec 2002 03:58:28 -0000	1.29
***************
*** 42,46 ****
  		if (check_time_args(hour, minute, second, usecond) < 0)
  			return NULL;
! 		if (check_tzinfo_subclass(tzinfo, "tzinfo argument") < 0)
  			return NULL;
  		self = new_timetz(hour, minute, second, usecond, tzinfo);
--- 42,46 ----
  		if (check_time_args(hour, minute, second, usecond) < 0)
  			return NULL;
! 		if (check_tzinfo_subclass(tzinfo) < 0)
  			return NULL;
  		self = new_timetz(hour, minute, second, usecond, tzinfo);