Removed unreachable code by radarhere · Pull Request #8918 · python-pillow/Pillow

Conversation

@radarhere

def i8(c: bytes) -> int:
return c[0]

def next(self) -> int:
return i8(self.fp.read(1))
def peek(self, bits: int) -> int:
while self.bits < bits:
c = self.next()
if c < 0:
self.bits = 0
continue

c < 0 will never be True. The value can range from 0 to 255, but will never be less than zero.

wiredfool

@Metallicow

Ok. Fair enough.
Unless it is double masked on purpose, but
I wouldn't see much of an issue, other than a dead body. At which point, I'm not much of a facilitator of anything.

Labels