summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1998-10-07 16:35:25 (GMT)
committerGuido van Rossum <guido@python.org>1998-10-07 16:35:25 (GMT)
commitc20687355b02106bd6a13ec3a3a26c5379e6097c (patch)
tree722da3b9cd1ab3881401fd098e9e1481f000bcbc /Modules
parent7148ca9d1468fddb47f730525ce758106cdb9646 (diff)
downloadcpython-c20687355b02106bd6a13ec3a3a26c5379e6097c.zip
cpython-c20687355b02106bd6a13ec3a3a26c5379e6097c.tar.gz
cpython-c20687355b02106bd6a13ec3a3a26c5379e6097c.tar.bz2
Make gcc -Wall happy:
(1) add dummy decl for strptime(); (2) move the code to set accept2dyear to the front of inittime().
Diffstat (limited to 'Modules')
-rw-r--r--Modules/timemodule.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/Modules/timemodule.c b/Modules/timemodule.c
index cde4897..0a0322d 100644
--- a/Modules/timemodule.c
+++ b/Modules/timemodule.c
@@ -402,6 +402,8 @@ See the library reference manual for formatting codes.";
#endif /* HAVE_STRFTIME */
#ifdef HAVE_STRPTIME
+extern char *strptime(); /* In case it's not declared somehow */
+
static PyObject *
time_strptime(self, args)
PyObject *self;
@@ -601,6 +603,12 @@ inittime()
char *p;
m = Py_InitModule3("time", time_methods, module_doc);
d = PyModule_GetDict(m);
+ /* Accept 2-digit dates unless PYTHONY2K is set and non-empty */
+ p = getenv("PYTHONY2K");
+ ins(d, "accept2dyear", PyInt_FromLong((long) (!p || !*p)));
+ /* Squirrel away the module's dictionary for the y2k check */
+ Py_INCREF(d);
+ moddict = d;
#ifdef HAVE_TZNAME
tzset();
#ifdef PYOS_OS2
@@ -619,12 +627,6 @@ inittime()
#endif
ins(d, "daylight", PyInt_FromLong((long)daylight));
ins(d, "tzname", Py_BuildValue("(zz)", tzname[0], tzname[1]));
- /* Accept 2-digit dates unless PYTHONY2K is set and non-empty */
- p = getenv("PYTHONY2K");
- ins(d, "accept2dyear", PyInt_FromLong((long) (!p || !*p)));
- /* Squirrel away the module's dictionary for the y2k check */
- Py_INCREF(d);
- moddict = d;
#else /* !HAVE_TZNAME */
#if HAVE_TM_ZONE
{