diff options
author | Zanie Blue <contact@zanie.dev> | 2025-01-03 10:04:03 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-03 10:04:03 (GMT) |
commit | bb2dfadb9221fa3035fda42a2c153c831013e3d3 (patch) | |
tree | 83bb96fbeb30f71b80f785148df7046696bb2229 /Modules | |
parent | bb73426cafb78691b249ffa50f1872ab6f899d4a (diff) | |
download | cpython-bb2dfadb9221fa3035fda42a2c153c831013e3d3.zip cpython-bb2dfadb9221fa3035fda42a2c153c831013e3d3.tar.gz cpython-bb2dfadb9221fa3035fda42a2c153c831013e3d3.tar.bz2 |
gh-128104: Remove `Py_STRFTIME_C99_SUPPORT`; require C99-compliant strftime (#128106)
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/_datetimemodule.c | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/Modules/_datetimemodule.c b/Modules/_datetimemodule.c index b110298..368d104 100644 --- a/Modules/_datetimemodule.c +++ b/Modules/_datetimemodule.c @@ -1912,9 +1912,7 @@ wrap_strftime(PyObject *object, PyObject *format, PyObject *timetuple, } #ifdef Py_NORMALIZE_CENTURY else if (ch == 'Y' || ch == 'G' -#ifdef Py_STRFTIME_C99_SUPPORT || ch == 'F' || ch == 'C' -#endif ) { /* 0-pad year with century as necessary */ PyObject *item = PySequence_GetItem(timetuple, 0); @@ -1952,15 +1950,11 @@ wrap_strftime(PyObject *object, PyObject *format, PyObject *timetuple, * +6 to accommodate dashes, 2-digit month and day for %F. */ char buf[SIZEOF_LONG * 5 / 2 + 2 + 6]; Py_ssize_t n = PyOS_snprintf(buf, sizeof(buf), -#ifdef Py_STRFTIME_C99_SUPPORT ch == 'F' ? "%04ld-%%m-%%d" : -#endif "%04ld", year_long); -#ifdef Py_STRFTIME_C99_SUPPORT if (ch == 'C') { n -= 2; } -#endif if (_PyUnicodeWriter_WriteSubstring(&writer, format, start, end) < 0) { goto Error; } |