summaryrefslogtreecommitdiffstats
path: root/Modules/timemodule.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2011-01-08 03:06:52 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2011-01-08 03:06:52 (GMT)
commit301f1217ac18e612c71e18f8fbebbdf31727eb47 (patch)
tree5427416790cacdadf4cec3ccc2978c925ef2679f /Modules/timemodule.c
parentaf5aee57c98d4529218c517ee6d73c3f78bc6738 (diff)
downloadcpython-301f1217ac18e612c71e18f8fbebbdf31727eb47.zip
cpython-301f1217ac18e612c71e18f8fbebbdf31727eb47.tar.gz
cpython-301f1217ac18e612c71e18f8fbebbdf31727eb47.tar.bz2
Issue #1777412: Remove all limits on tm_year from time.strftime()
The buildbots will tell us which platform does support or not negative years.
Diffstat (limited to 'Modules/timemodule.c')
-rw-r--r--Modules/timemodule.c9
1 files changed, 1 insertions, 8 deletions
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 @@ gettmarg(PyObject *args, struct tm *p)
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 @@ time_strftime(PyObject *self, PyObject *args)
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