Issue #1777412: Remove all limits on tm_year from time.strftime()
The buildbots will tell us which platform does support or not negative years.
diff --git a/Modules/timemodule.c b/Modules/timemodule.c
index de1588f..314d8c3 100644
--- a/Modules/timemodule.c
+++ b/Modules/timemodule.c
@@ -332,7 +332,7 @@
if (y < 1000) {
PyObject *accept = PyDict_GetItemString(moddict,
"accept2dyear");
- if (accept != NULL) {
+ if (accept != NULL) {
int acceptval = PyObject_IsTrue(accept);
if (acceptval == -1)
return 0;
@@ -481,13 +481,6 @@
buf.tm_year + 1900);
return NULL;
}
-#else
- if (buf.tm_year + 1900 < 1) {
- PyErr_Format(PyExc_ValueError,
- "strftime() requires year >= 1",
- buf.tm_year + 1900);
- return NULL;
- }
#endif
/* Normalize tm_isdst just in case someone foolishly implements %Z