A new version of sortedcontainers has been available for some time, as can be seen on its PyPI page. A simple version bump to 2.1.0 appears to work. Reproducible: Always
The PyPI page in question, in case the URL at the top of the report isn't a very obvious place to check: https://pypi.org/project/sortedcontainers/#history
Fixed in https://cgit.gentoo.org/repo/gentoo.git/commit/?id=eaf356158863f900c04362bc531624cb5f1f27ca