diff --git a/Lib/colorsys.py b/Lib/colorsys.py index e97f91718a3a30..563f523b8b0028 100644 --- a/Lib/colorsys.py +++ b/Lib/colorsys.py @@ -161,6 +161,6 @@ def hsv_to_rgb(h, s, v): return p, q, v if i == 4: return t, p, v - if i == 5: + else: return v, p, q # Cannot get here diff --git a/Misc/NEWS.d/next/Library/2026-07-23-01-40-17.gh-issue-99999.UehozK.rst b/Misc/NEWS.d/next/Library/2026-07-23-01-40-17.gh-issue-99999.UehozK.rst new file mode 100644 index 00000000000000..651c978fda6424 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2026-07-23-01-40-17.gh-issue-99999.UehozK.rst @@ -0,0 +1 @@ +Refactor hsv_to_rgb in colorsys to remove a dead code branch.