Skip to content

Commit 0f8473a

Browse files
committed
pylint fix
1 parent b3c01e0 commit 0f8473a

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

test/helpers.py

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -85,17 +85,13 @@ def __init__(self, fig):
8585
stderr=subprocess.STDOUT
8686
).decode('utf-8')
8787
# Extract page size
88-
dims = None
89-
for line in pdfinfo_out.split('\n'):
90-
# Page size: 195.106 x 156.239 pts
91-
m = re.match(
92-
'Page size: *([0-9]+\.[0-9]+) x ([0-9]+\.[0-9]+) pts',
93-
line
94-
)
95-
if m:
96-
# get dims in inches
97-
dims = [float(m.group(1)) / 72, float(m.group(2)) / 72]
98-
break
88+
# Page size: 195.106 x 156.239 pts
89+
m = re.search(
90+
'Page size: *([0-9]+\.[0-9]+) x ([0-9]+\.[0-9]+) pts',
91+
pdfinfo_out
92+
)
93+
# get dims in inches
94+
dims = [float(m.group(1)) / 72, float(m.group(2)) / 72]
9995
assert dims is not None
10096
max_num_pixels = 89e6
10197
max_dpi = math.sqrt(max_num_pixels / dims[0] / dims[1])

0 commit comments

Comments
 (0)