From 06ec45e2f8108d6bfc1fa8abe80de94bc4eeb8a3 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Sat, 8 Jan 2011 03:35:36 +0000 Subject: [PATCH] Issue #10864: limit year to [1; 9999] for strftime() on Solaris --- Modules/timemodule.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/timemodule.c b/Modules/timemodule.c index 314d8c3a2c..2286006113 100644 --- a/Modules/timemodule.c +++ b/Modules/timemodule.c @@ -474,7 +474,7 @@ time_strftime(PyObject *self, PyObject *args) else if (!gettmarg(tup, &buf) || !checktm(&buf)) return NULL; -#ifdef _MSC_VER +#if defined(_MSC_VER) || defined(sun) if (buf.tm_year + 1900 < 1 || 9999 < buf.tm_year + 1900) { PyErr_Format(PyExc_ValueError, "strftime() requires year in [1; 9999]", -- 2.40.0