mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-14 13:46:57 +03:00
Rewrite _ignore_comment
as one-liner
This commit is contained in:
parent
b43654d159
commit
b6f6fba8cf
|
@ -61,10 +61,8 @@ class PpmImageFile(ImageFile.ImageFile):
|
||||||
|
|
||||||
def _read_token(self, token=b""):
|
def _read_token(self, token=b""):
|
||||||
def _ignore_comment(): # ignores rest of the line; stops at CR, LF or EOF
|
def _ignore_comment(): # ignores rest of the line; stops at CR, LF or EOF
|
||||||
while True:
|
while self.fp.read(1) not in b"\r\n":
|
||||||
c = self.fp.read(1)
|
pass
|
||||||
if c in b"\r\n":
|
|
||||||
break
|
|
||||||
|
|
||||||
while True: # read until non-whitespace is found
|
while True: # read until non-whitespace is found
|
||||||
c = self.fp.read(1)
|
c = self.fp.read(1)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user