Skip to content

Commit f044d53

Browse files
nulanohugovk
andauthored
swap conditions
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
1 parent 0d841aa commit f044d53

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/PIL/PpmImagePlugin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def _open(self):
115115
for ix in range(3):
116116
if mode == "F" and ix == 2:
117117
scale = float(self._read_token())
118-
if not math.isfinite(scale) or scale == 0.0:
118+
if scale == 0.0 or not math.isfinite(scale):
119119
msg = "scale must be finite and non-zero"
120120
raise ValueError(msg)
121121
rawmode = "F;32F" if scale < 0 else "F;32BF"

0 commit comments

Comments
 (0)