From b43654d15954a5af46ad618291b7c859549ccc63 Mon Sep 17 00:00:00 2001 From: Piolie Date: Sun, 10 Jan 2021 18:45:46 -0300 Subject: [PATCH] Change variable name in `_read_magic()` --- src/PIL/PpmImagePlugin.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/PIL/PpmImagePlugin.py b/src/PIL/PpmImagePlugin.py index 93ce3a4d2..e25b4bcec 100644 --- a/src/PIL/PpmImagePlugin.py +++ b/src/PIL/PpmImagePlugin.py @@ -49,15 +49,15 @@ class PpmImageFile(ImageFile.ImageFile): format = "PPM" format_description = "Pbmplus image" - def _read_magic(self, s=b""): + def _read_magic(self, magic=b""): while True: # read until next whitespace c = self.fp.read(1) if c in B_WHITESPACE: break - s = s + c - if len(s) > 6: # exceeded max magic number length + magic += c + if len(magic) > 6: # exceeded max magic number length break - return s + return magic def _read_token(self, token=b""): def _ignore_comment(): # ignores rest of the line; stops at CR, LF or EOF