Skip to content

Commit b745fed

Browse files
test_json: added Comment
1 parent 765ffb2 commit b745fed

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Lib/test/test_json/test_fail.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,10 @@ def __call__(self, *args, **kwargs):
254254
orig_decoder_error = json.decoder.JSONDecodeError
255255

256256
try:
257+
# NOTE: Do not use swap_attr() here.
258+
# swap_attr() keeps the replacement object alive for the duration of
259+
# the context manager, which prevents the crash this test is meant
260+
# to reproduce
257261
json.JSONDecodeError = hook
258262
json.decoder.JSONDecodeError = hook
259263
del hook

0 commit comments

Comments
 (0)