Skip to content

Commit 0ec672f

Browse files
committed
use f-string for the error
1 parent 2044b57 commit 0ec672f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/matplotlib/cm.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -373,8 +373,8 @@ def set_array(self, A):
373373

374374
A = cbook.safe_masked_invalid(A, copy=True)
375375
if not np.can_cast(A.dtype, float, "same_kind"):
376-
raise TypeError("Image data of dtype {} cannot be converted to "
377-
"float".format(A.dtype))
376+
raise TypeError(f"Image data of dtype {A.dtype} cannot be "
377+
"converted to float")
378378

379379
self._A = A
380380

0 commit comments

Comments
 (0)