Skip to content

Commit 01f381a

Browse files
committed
Replaced assert by an if
1 parent b70d887 commit 01f381a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

jsonrpclib/jsonrpc.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,8 +286,12 @@ def pop_headers(self, headers):
286286
:raise AssertionError: The given dictionary is not on the latest stored
287287
in the additional headers list
288288
"""
289-
assert self.additional_headers[-1] == headers
290-
self.additional_headers.pop()
289+
if self.additional_headers[-1] == headers:
290+
self.additional_headers.pop()
291+
else:
292+
raise AssertionError(
293+
"Headers to remove are not the top of the stack"
294+
)
291295

292296
def emit_additional_headers(self, connection):
293297
"""

0 commit comments

Comments
 (0)