Address comments

This commit is contained in:
Alex Adamson
2019-01-10 15:45:48 -05:00
parent ac2bf10fe2
commit 0ee219dc48
3 changed files with 4 additions and 5 deletions

View File

@@ -1,2 +1,2 @@
Attributes of _WARNING_DETAILS are checked to make sure they can be dumped Warning attributes are checked to make sure they can be dumped prior to
prior to serializing the warning for submission to the master node. serializing the warning for submission to the master node.

View File

@@ -825,9 +825,8 @@ class TestWarnings:
# The socket itself will end up attached as a value in # The socket itself will end up attached as a value in
# _WARNING_DETAIL. We need to test that it is not serialized # _WARNING_DETAIL. We need to test that it is not serialized
# (it can't be, so the test will fail if we try to). # (it can't be, so the test will fail if we try to).
@pytest.mark.filterwarnings('always')
def test_func(tmpdir): def test_func(tmpdir):
warnings.resetwarnings()
warnings.simplefilter('always', ResourceWarning)
abuse_socket() abuse_socket()
gc.collect() gc.collect()
""" """

View File

@@ -224,7 +224,7 @@ def serialize_warning_message(warning_message):
try: try:
dumps(attr) dumps(attr)
except DumpError: except DumpError:
result[attr_name] = None result[attr_name] = repr(attr)
else: else:
result[attr_name] = attr result[attr_name] = attr
return result return result