[3.7] bpo-35021: Fix assertion failures in _datetimemodule.c. (GH-10039) by miss-islington · Pull Request #10614 · python/cpython (original) (raw)

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 3ec0f49)

Co-authored-by: Serhiy Storchaka storchaka@gmail.com

https://bugs.python.org/issue35021