diff options
| author | Alexander Belopolsky <alexander.belopolsky@gmail.com> | 2011-01-08 00:13:34 +0000 |
|---|---|---|
| committer | Alexander Belopolsky <alexander.belopolsky@gmail.com> | 2011-01-08 00:13:34 +0000 |
| commit | b8bb4664fc8cb833f0fd50c9dac4f6c3be032784 (patch) | |
| tree | 1b02d0fbb69e4849a2f4e0c48d7f33fa088b0bd0 /Modules/_datetimemodule.c | |
| parent | 9253214fd9fe22b8b2b4ca5bb28952df8cab3e8c (diff) | |
| download | cpython-git-b8bb4664fc8cb833f0fd50c9dac4f6c3be032784.tar.gz | |
Issue #1777412: extended year range of strftime down to 1000.
Diffstat (limited to 'Modules/_datetimemodule.c')
| -rw-r--r-- | Modules/_datetimemodule.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Modules/_datetimemodule.c b/Modules/_datetimemodule.c index 16964d8dbe..61959405e8 100644 --- a/Modules/_datetimemodule.c +++ b/Modules/_datetimemodule.c @@ -1166,10 +1166,10 @@ wrap_strftime(PyObject *object, PyObject *format, PyObject *timetuple, if (!pin) return NULL; - /* Give up if the year is before 1900. + /* Give up if the year is before 1000. * Python strftime() plays games with the year, and different * games depending on whether envar PYTHON2K is set. This makes - * years before 1900 a nightmare, even if the platform strftime + * years before 1000 a nightmare, even if the platform strftime * supports them (and not all do). * We could get a lot farther here by avoiding Python's strftime * wrapper and calling the C strftime() directly, but that isn't @@ -1182,10 +1182,10 @@ wrap_strftime(PyObject *object, PyObject *format, PyObject *timetuple, assert(PyLong_Check(pyyear)); year = PyLong_AsLong(pyyear); Py_DECREF(pyyear); - if (year < 1900) { + if (year < 1000) { PyErr_Format(PyExc_ValueError, "year=%ld is before " - "1900; the datetime strftime() " - "methods require year >= 1900", + "1000; the datetime strftime() " + "methods require year >= 1000", year); return NULL; } @@ -3663,7 +3663,7 @@ time_strftime(PyDateTime_Time *self, PyObject *args, PyObject *kw) /* Python's strftime does insane things with the year part of the * timetuple. The year is forced to (the otherwise nonsensical) - * 1900 to worm around that. + * 1900 to work around that. */ tuple = Py_BuildValue("iiiiiiiii", 1900, 1, 1, /* year, month, day */ |
