Make test fails on time module with Python 1.5.2/Linux2/EGCS! Help!
M.-A. Lemburg
mal at lemburg.com
Thu May 13 04:32:00 EDT 1999
guido at python.org wrote:
>
> "M.-A. Lemburg" <mal at lemburg.com> writes:
>
> > Looks like the #ifdefs in Module/timemodule.c are buggy: the
> > globals are only set if HAVE_TM_ZONE is true in case the
> > symbol __GNU_LIBRARY__ is defined. Well for libc5 the latter
> > is defined, but the configure script only tests for the
> > tm.tm_zone field and not for tm.__tm_zone__ that libc5 defines.
> > That's why you don't see the globals.
>
> This was discussed before. Someone with CVS access please post the patch!
Should have looked there first...
--- /home/lemburg/orig/Python-1.5.2/Modules/timemodule.c Mon Apr 5 23:54:14 1999
+++ ./timemodule.c Mon Apr 26 21:03:02 1999
@@ -614,11 +614,11 @@ inittime()
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;
-#if defined(HAVE_TZNAME) && !defined(__GNU_LIBRARY__)
+#if defined(HAVE_TZNAME) && !defined(__GLIBC__)
tzset();
#ifdef PYOS_OS2
ins(d, "timezone", PyInt_FromLong((long)_timezone));
#else /* !PYOS_OS2 */
ins(d, "timezone", PyInt_FromLong((long)timezone));
@@ -632,11 +632,11 @@ inittime()
ins(d, "altzone", PyInt_FromLong((long)timezone-3600));
#endif /* PYOS_OS2 */
#endif
ins(d, "daylight", PyInt_FromLong((long)daylight));
ins(d, "tzname", Py_BuildValue("(zz)", tzname[0], tzname[1]));
-#else /* !HAVE_TZNAME || __GNU_LIBRARY__ */
+#else /* !HAVE_TZNAME || __GLIBC__ */
#ifdef HAVE_TM_ZONE
{
#define YEAR ((time_t)((365 * 24 + 6) * 3600))
time_t t;
struct tm *p;
@@ -681,11 +681,11 @@ inittime()
ins(d, "altzone", PyInt_FromLong(timezone));
ins(d, "daylight", PyInt_FromLong((long)0));
ins(d, "tzname", Py_BuildValue("(zz)", "", ""));
#endif /* macintosh */
#endif /* HAVE_TM_ZONE */
-#endif /* !HAVE_TZNAME || __GNU_LIBRARY__ */
+#endif /* !HAVE_TZNAME || __GLIBC__ */
if (PyErr_Occurred())
Py_FatalError("Can't initialize time module");
}
--
Marc-Andre Lemburg
______________________________________________________________________
Y2000: Y2000: 232 days left
Business: http://www.lemburg.com/
Python Pages: http://starship.python.net/crew/lemburg/
More information about the Python-list
mailing list