mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
bpo-37372: Fix error unpickling datetime.time objects from Python 2 with seconds>=24. (GH-14307)
This commit is contained in:
parent
e64f948e76
commit
122376df55
4 changed files with 22 additions and 10 deletions
|
@ -4078,7 +4078,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