]> granicus.if.org Git - python/commit
bpo-38005: Fixed comparing and creating of InterpreterID and ChannelID. (GH-15652)
authorSerhiy Storchaka <storchaka@gmail.com>
Fri, 13 Sep 2019 19:50:27 +0000 (22:50 +0300)
committerGitHub <noreply@github.com>
Fri, 13 Sep 2019 19:50:27 +0000 (22:50 +0300)
commitbf169915ecdd42329726104278eb723a7dda2736
treea7d78e17ab50c98822a9ea307068a1eac9531faa
parente082e7cbe4a934b86f7a07354d97d4e14a9dd46a
bpo-38005: Fixed comparing and creating of InterpreterID and ChannelID. (GH-15652)

* 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.
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