mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
gh-128770: raise warnings as errors in test suite - except for test_socket which still logs warnings, and internal test warnings that are now logged (#128973)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
This commit is contained in:
parent
972a295fe3
commit
8a00c9a4d2
15 changed files with 232 additions and 137 deletions
|
@ -1,6 +1,7 @@
|
|||
from collections import namedtuple
|
||||
import contextlib
|
||||
import json
|
||||
import logging
|
||||
import os
|
||||
import os.path
|
||||
#import select
|
||||
|
@ -66,8 +67,8 @@ def pack_exception(exc=None):
|
|||
def unpack_exception(packed):
|
||||
try:
|
||||
data = json.loads(packed)
|
||||
except json.decoder.JSONDecodeError:
|
||||
warnings.warn('incomplete exception data', RuntimeWarning)
|
||||
except json.decoder.JSONDecodeError as e:
|
||||
logging.getLogger(__name__).warning('incomplete exception data', exc_info=e)
|
||||
print(packed if isinstance(packed, str) else packed.decode('utf-8'))
|
||||
return None
|
||||
exc = types.SimpleNamespace(**data)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue