From 138d08f2b6de9d3b013d60add4de09b8f88858da Mon Sep 17 00:00:00 2001 From: pubpub-zz <4083478+pubpub-zz@users.noreply.github.com> Date: Wed, 20 Jul 2022 23:02:35 +0200 Subject: [PATCH] Update PyPDF2/_cmap.py Co-authored-by: Martin Thoma --- PyPDF2/_cmap.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PyPDF2/_cmap.py b/PyPDF2/_cmap.py index 2c03daf64..36d12f476 100644 --- a/PyPDF2/_cmap.py +++ b/PyPDF2/_cmap.py @@ -284,9 +284,9 @@ def compute_space_width( w1[-1] = cast(float, ft1["/DW"]) except Exception: w1[-1] = 1000.0 - try: + if "/W" in ft1: w = list(ft1["/W"]) # type: ignore - except Exception: + else: w = [] while len(w) > 0: st = w[0]