]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[2.7] bpo-35021: Fix assertion failures in _datetimemodule.c. (GH-10039) (GH-10617)
authorSerhiy Storchaka <storchaka@gmail.com>
Tue, 20 Nov 2018 19:56:34 +0000 (21:56 +0200)
committerGitHub <noreply@github.com>
Tue, 20 Nov 2018 19:56:34 +0000 (21:56 +0200)
commit40fdf471931f029ea07e6190f0fe116e0735661b
tree4c63c34560f8cb83cd586f09bc87fb226bf76eef
parent4845aa6ef813313051db34726afc76c0e7dc5fee
[2.7] bpo-35021: Fix assertion failures in _datetimemodule.c. (GH-10039) (GH-10617)

Fixes assertion failures in _datetimemodule.c
introduced in the previous fix (see bpo-31752).

Rather of trying to handle an int subclass as exact int,
let it to use overridden special methods, but check the
result of divmod().
(cherry picked from commit 3ec0f495163da3b7a15deb2805cec48aed432f58)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Lib/test/test_datetime.py
Modules/datetimemodule.c