Skip to content

Commit 722c336

Browse files
committed
Handle TypeError when loading possibly compressed response
Now 2.7, and all 3.x except 3.4 are passing. Handle TypeError raised by python 3.4.
1 parent 8aac964 commit 722c336

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/test_liveserver.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ def test_compression_br(self):
534534

535535
try:
536536
json_dict = json.loads(f.content)
537-
except (ValueError):
537+
except (ValueError, TypeError):
538538
# Handle error from trying to load compressed data
539539
json_dict = json.loads(b2s(brotli.decompress(f.content)))
540540

@@ -678,7 +678,7 @@ def test_compression_zstd(self):
678678

679679
try:
680680
json_dict = json.loads(f.content)
681-
except (ValueError, UnicodeDecodeError):
681+
except (ValueError, UnicodeDecodeError, TypeError):
682682
# ValueError - raised by loads on compressed content python2
683683
# UnicodeDecodeError - raised by loads on compressed content
684684
# python3

0 commit comments

Comments
 (0)