Skip to content

Commit cb4e267

Browse files
committed
Retain variable case for backwards compatibility
1 parent e2e87d7 commit cb4e267

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/PIL/PpmImagePlugin.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#
2121
# --------------------------------------------------------------------
2222

23-
B_WHITESPACE = b"\x20\x09\x0a\x0b\x0c\x0d"
23+
b_whitespace = b"\x20\x09\x0a\x0b\x0c\x0d"
2424

2525
MODES = {
2626
# standard
@@ -52,7 +52,7 @@ class PpmImageFile(ImageFile.ImageFile):
5252
def _read_magic(self, magic=b""):
5353
while True: # read until next whitespace
5454
c = self.fp.read(1)
55-
if c in B_WHITESPACE:
55+
if c in b_whitespace:
5656
break
5757
magic += c
5858
if len(magic) > 6: # exceeded max magic number length
@@ -69,7 +69,7 @@ def _ignore_comment(): # ignores rest of the line; stops at CR, LF or EOF
6969
if c == b"#": # found comment, ignore it
7070
_ignore_comment()
7171
continue
72-
if c in B_WHITESPACE: # found whitespace, ignore it
72+
if c in b_whitespace: # found whitespace, ignore it
7373
if c == b"": # reached EOF
7474
raise ValueError("Reached EOF while reading header")
7575
continue
@@ -82,7 +82,7 @@ def _ignore_comment(): # ignores rest of the line; stops at CR, LF or EOF
8282
if c == b"#":
8383
_ignore_comment()
8484
continue
85-
if c in B_WHITESPACE: # token ended
85+
if c in b_whitespace: # token ended
8686
break
8787
token += c
8888
if len(token) > 10:

0 commit comments

Comments
 (0)