Mercurial > p > roundup > code
changeset 6460:3d2c17be1d35
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.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Sat, 24 Jul 2021 19:47:00 -0400 |
| parents | 0e86ea84e59d |
| children | d067b089b90b |
| files | test/test_liveserver.py |
| diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/test/test_liveserver.py Sat Jul 24 18:23:21 2021 -0400 +++ b/test/test_liveserver.py Sat Jul 24 19:47:00 2021 -0400 @@ -534,7 +534,7 @@ try: json_dict = json.loads(f.content) - except (ValueError): + except (ValueError, TypeError): # Handle error from trying to load compressed data json_dict = json.loads(b2s(brotli.decompress(f.content))) @@ -678,7 +678,7 @@ try: json_dict = json.loads(f.content) - except (ValueError, UnicodeDecodeError): + except (ValueError, UnicodeDecodeError, TypeError): # ValueError - raised by loads on compressed content python2 # UnicodeDecodeError - raised by loads on compressed content # python3
