diff options
author | marcoagner <marco@agner.io> | 2018-07-19 12:14:05 +0100 |
---|---|---|
committer | marcoagner <marco@agner.io> | 2018-07-19 12:24:31 +0100 |
commit | ea5340c9d24b5b59b178c06e7cb25495a282fdd0 (patch) | |
tree | 6992387bfefd974d599c335679d184c2ad4a812e /test | |
parent | 4a3e8c5aa6a5d8dda15a76d644b2a9f0f40cdec7 (diff) |
tests: fixes mininode's P2PConnection sending messages on closing transport
- checks if _transport.is_closing() (added in python3.4.4/python3.5.1)
before attempting to send messages on P2PConnection's send_message
method.
Diffstat (limited to 'test')
-rwxr-xr-x | test/functional/test_framework/mininode.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/test/functional/test_framework/mininode.py b/test/functional/test_framework/mininode.py index 29bf33fa5b..d5b1a90687 100755 --- a/test/functional/test_framework/mininode.py +++ b/test/functional/test_framework/mininode.py @@ -179,7 +179,7 @@ class P2PConnection(asyncio.Protocol): raise IOError('Not connected') self._log_message("send", message) tmsg = self._build_message(message) - NetworkThread.network_event_loop.call_soon_threadsafe(lambda: self._transport and self._transport.write(tmsg)) + NetworkThread.network_event_loop.call_soon_threadsafe(lambda: self._transport and not self._transport.is_closing() and self._transport.write(tmsg)) # Class utility methods |