mirror of
https://github.com/python/cpython.git
synced 2026-01-06 15:32:22 +00:00
bpo-37372: Fix error unpickling datetime.time objects from Python 2 with seconds>=24. (GH-14307)
(cherry picked from commit 122376df55)
Co-authored-by: Justin Blanchard <UncombedCoconut@gmail.com>
This commit is contained in:
parent
097eae5b9b
commit
d1d42bf4a4
4 changed files with 22 additions and 10 deletions
|
|
@ -4081,7 +4081,7 @@ time_new(PyTypeObject *type, PyObject *args, PyObject *kw)
|
|||
return NULL;
|
||||
}
|
||||
if (PyUnicode_GET_LENGTH(state) == _PyDateTime_TIME_DATASIZE &&
|
||||
(0x7F & PyUnicode_READ_CHAR(state, 2)) < 24)
|
||||
(0x7F & PyUnicode_READ_CHAR(state, 0)) < 24)
|
||||
{
|
||||
state = PyUnicode_AsLatin1String(state);
|
||||
if (state == NULL) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue