diff --git a/src/PIL/ImageCms.py b/src/PIL/ImageCms.py index 52937ce83..b6e5b9e8f 100644 --- a/src/PIL/ImageCms.py +++ b/src/PIL/ImageCms.py @@ -797,9 +797,6 @@ def createProfile( except (TypeError, ValueError) as e: msg = f'Color temperature must be numeric, "{colorTemp}" not valid' raise PyCMSError(msg) from e - else: - # colorTemp is unused if colorSpace != "LAB" - colorTemp = 0.0 try: return core.createProfile(colorSpace, colorTemp) diff --git a/src/PIL/_imagingcms.pyi b/src/PIL/_imagingcms.pyi index 723f80481..036521b0e 100644 --- a/src/PIL/_imagingcms.pyi +++ b/src/PIL/_imagingcms.pyi @@ -1,6 +1,6 @@ import datetime import sys -from typing import Literal, TypedDict +from typing import Literal, SupportsFloat, TypedDict littlecms_version: str @@ -138,7 +138,7 @@ def buildProofTransform( /, ) -> CmsTransform: ... def createProfile( - color_space: Literal["LAB", "XYZ", "sRGB"], color_temp: float = 0.0, / + color_space: Literal["LAB", "XYZ", "sRGB"], color_temp: SupportsFloat = 0.0, / ) -> CmsProfile: ... if sys.platform == "win32":