Skip to content

Commit 532f424

Browse files
authored
Merge pull request #21624 from meeseeksmachine/auto-backport-of-pr-21621-on-v3.5.x
Backport PR #21621 on branch v3.5.x (Fix GhostScript error handling types)
2 parents 29c5644 + b6970a3 commit 532f424

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

lib/matplotlib/testing/compare.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,7 @@ def encode_and_escape(name):
136136
self._proc.stdin.flush()
137137
# GS> if nothing left on the stack; GS<n> if n items left on the stack.
138138
err = self._read_until((b"GS<", b"GS>"))
139-
stack = ""
140-
if err.endswith(b"GS<"):
141-
stack = self._read_until(b">")
139+
stack = self._read_until(b">") if err.endswith(b"GS<") else b""
142140
if stack or not os.path.exists(dest):
143141
stack_size = int(stack[:-1]) if stack else 0
144142
self._proc.stdin.write(b"pop\n" * stack_size)

0 commit comments

Comments
 (0)