]> granicus.if.org Git - python/commit
[3.8] bpo-38005: Fixed comparing and creating of InterpreterID and ChannelID. (GH...
authorSerhiy Storchaka <storchaka@gmail.com>
Sat, 14 Sep 2019 16:36:19 +0000 (19:36 +0300)
committerGitHub <noreply@github.com>
Sat, 14 Sep 2019 16:36:19 +0000 (19:36 +0300)
commitf37a9831027ecfe948697cdb5e35b417805d94e5
tree50a4b37c48bba3a6bec7811ba7e74ded2a48bdd1
parentd322abbb83eb751045246a70f39d040d13a6108b
[3.8] bpo-38005: Fixed comparing and creating of InterpreterID and ChannelID. (GH-15652) (GH-16145)

* Fix a crash in comparing with float (and maybe other crashes).
* They are now never equal to strings and non-integer numbers.
* Comparison with a large number no longer raises OverflowError.
* Arbitrary exceptions no longer silenced in constructors and comparisons.
* TypeError raised in the constructor contains now the name of the type.
* Accept only ChannelID and int-like objects in channel functions.
* Accept only InterpreterId, int-like objects and str in the InterpreterId constructor.
* Accept int-like objects, not just int in interpreter related functions.
(cherry picked from commit bf169915ecdd42329726104278eb723a7dda2736)
Include/cpython/interpreteridobject.h
Lib/test/test__xxsubinterpreters.py
Misc/NEWS.d/next/Core and Builtins/2019-09-02-20-00-31.bpo-38005.e7VsTA.rst [new file with mode: 0644]
Modules/_xxsubinterpretersmodule.c
Objects/interpreteridobject.c