]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-99248: [Enum] fix negative number infinite loop (GH-99256)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 8 Nov 2022 20:33:21 +0000 (12:33 -0800)
committerGitHub <noreply@github.com>
Tue, 8 Nov 2022 20:33:21 +0000 (12:33 -0800)
commit4f31171e3fcef0a81b3d9186b28cd0596aaff771
treeef12b2db4f70ffdbb504bd765fd0fc7a5d4c1539
parentca944628acd83243f1511d118d39091dae82224f
gh-99248: [Enum] fix negative number infinite loop (GH-99256)

[Enum] fix negative number infinite loop

- _iter_bits_lsb() now raises a ValueError if a negative number
  is passed in

- verify() now skips checking negative numbers for named flags
(cherry picked from commit 0b4ffb08ccdc21fc07ce90d3f78b58a25e1af653)

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
Lib/enum.py
Lib/test/test_enum.py
Misc/NEWS.d/next/Library/2022-11-08-11-15-37.gh-issue-99248.1vt8xI.rst [new file with mode: 0644]