mirror of
https://github.com/python/cpython.git
synced 2025-10-30 01:47:38 +00:00
Make gcc -Wall happy:
(1) add dummy decl for strptime(); (2) move the code to set accept2dyear to the front of inittime().
This commit is contained in:
parent
7148ca9d14
commit
c20687355b
1 changed files with 8 additions and 6 deletions
|
|
@ -402,6 +402,8 @@ See the library reference manual for formatting codes.";
|
||||||
#endif /* HAVE_STRFTIME */
|
#endif /* HAVE_STRFTIME */
|
||||||
|
|
||||||
#ifdef HAVE_STRPTIME
|
#ifdef HAVE_STRPTIME
|
||||||
|
extern char *strptime(); /* In case it's not declared somehow */
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
time_strptime(self, args)
|
time_strptime(self, args)
|
||||||
PyObject *self;
|
PyObject *self;
|
||||||
|
|
@ -601,6 +603,12 @@ inittime()
|
||||||
char *p;
|
char *p;
|
||||||
m = Py_InitModule3("time", time_methods, module_doc);
|
m = Py_InitModule3("time", time_methods, module_doc);
|
||||||
d = PyModule_GetDict(m);
|
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
|
#ifdef HAVE_TZNAME
|
||||||
tzset();
|
tzset();
|
||||||
#ifdef PYOS_OS2
|
#ifdef PYOS_OS2
|
||||||
|
|
@ -619,12 +627,6 @@ inittime()
|
||||||
#endif
|
#endif
|
||||||
ins(d, "daylight", PyInt_FromLong((long)daylight));
|
ins(d, "daylight", PyInt_FromLong((long)daylight));
|
||||||
ins(d, "tzname", Py_BuildValue("(zz)", tzname[0], tzname[1]));
|
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 */
|
#else /* !HAVE_TZNAME */
|
||||||
#if HAVE_TM_ZONE
|
#if HAVE_TM_ZONE
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue