From 73fed77c0c58efd2ce11b8c0e96858bd03655163 Mon Sep 17 00:00:00 2001 From: Piolie Date: Wed, 6 Jan 2021 14:46:30 -0300 Subject: [PATCH] Suppress exception context --- src/PIL/PpmImagePlugin.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/PIL/PpmImagePlugin.py b/src/PIL/PpmImagePlugin.py index efd845d3b..8bd7d16db 100644 --- a/src/PIL/PpmImagePlugin.py +++ b/src/PIL/PpmImagePlugin.py @@ -115,7 +115,9 @@ class PpmImageFile(ImageFile.ImageFile): try: # check token sanity token = int(token) except ValueError: - raise ValueError(f"Non-decimal-ASCII found in header: {token}") + raise ValueError( + f"Non-decimal-ASCII found in header: {token}" + ) from None if ix == 0: # token is the x size xsize = token elif ix == 1: # token is the y size