Mailing List Archive

CVS: python/nondist/sandbox/datetime Makefile,1.3,1.4 datetime.c,1.10,1.11
Update of /cvsroot/python/python/nondist/sandbox/datetime
In directory usw-pr-cvs1:/tmp/cvs-serv27270

Modified Files:
Makefile datetime.c
Log Message:
Guido says we don't care about Python 2.2 compatibility here, so we can
keep the code as clean as possible.


Index: Makefile
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/datetime/Makefile,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** Makefile 5 Mar 2002 06:44:49 -0000 1.3
--- Makefile 28 Mar 2002 21:17:47 -0000 1.4
***************
*** 1,3 ****
! PYTHON=python2.2

default: check
--- 1,3 ----
! PYTHON=python2.3

default: check

Index: datetime.c
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/datetime/datetime.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** datetime.c 28 Mar 2002 14:07:43 -0000 1.10
--- datetime.c 28 Mar 2002 21:17:47 -0000 1.11
***************
*** 384,392 ****

static PyMethodDef datetime_methods[] = {
- #if PY_VERSION_HEX >= 0x02030000
/* Class methods: */
{"now", (PyCFunction)datetime_now, METH_O | METH_CLASS,
"Return a new datetime that represents the current time."},
! #endif
/* Instance methods: */
{"isocalendar", (PyCFunction)datetime_isocalendar, METH_NOARGS,
--- 384,391 ----

static PyMethodDef datetime_methods[] = {
/* Class methods: */
{"now", (PyCFunction)datetime_now, METH_O | METH_CLASS,
"Return a new datetime that represents the current time."},
!
/* Instance methods: */
{"isocalendar", (PyCFunction)datetime_isocalendar, METH_NOARGS,
***************
*** 407,417 ****


- #if PY_VERSION_HEX < 0x02030000
- static PyMethodDef datetime_now_mdef = {
- "now", (PyCFunction)datetime_now, METH_O,
- "Return a new datetime that represents the current time."
- };
- #endif
-
static char datetime_doc[] =
"Basic date/time type.";
--- 406,409 ----
***************
*** 490,510 ****
return;
Py_DECREF(dt);
-
- #if PY_VERSION_HEX < 0x02030000
- {
- PyObject *tmp;
- dt = PyCFunction_New(&datetime_now_mdef, NULL);
- if (dt == NULL)
- return;
- tmp = PyClassMethod_New(dt);
- Py_DECREF(dt);
- if (tmp == NULL)
- return;
- err = PyDict_SetItemString(d, "now", tmp);
- Py_DECREF(tmp);
- if (err < 0)
- return;
- }
- #endif

m = Py_InitModule3("_datetime", functions,
--- 482,485 ----