diff --git a/src/PIL/Image.py b/src/PIL/Image.py index 3409f575732..fbc24790a24 100644 --- a/src/PIL/Image.py +++ b/src/PIL/Image.py @@ -3361,7 +3361,8 @@ def fromarray(obj: SupportsArrayInterface, mode: str | None = None) -> Image: def fromarrow(obj: SupportsArrowArrayIngerface, mode, size) -> ImageFile.ImageFile: if not hasattr(obj, "__arrow_c_array__"): - raise ValueError("arrow_c_array interface not found") + msg = "arrow_c_array interface not found" + raise ValueError(msg) (schema_capsule, array_capsule) = obj.__arrow_c_array__() _im = core.new_arrow(mode, size, schema_capsule, array_capsule)