Skip to content

Commit 0c87403

Browse files
committed
An attempt to fix a test on Travis
1 parent 0d67b30 commit 0c87403

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tests/test_unix.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -507,9 +507,12 @@ def prog(sock):
507507
sock.close()
508508

509509
except Exception as ex:
510-
self.loop.call_soon_threadsafe(fut.set_exception, ex)
510+
self.loop.call_soon_threadsafe(
511+
lambda ex=ex:
512+
(fut.cancelled() or fut.set_exception(ex)))
511513
else:
512-
self.loop.call_soon_threadsafe(fut.set_result, None)
514+
self.loop.call_soon_threadsafe(
515+
lambda: (fut.cancelled() or fut.set_result(None)))
513516

514517
client = self.unix_client(prog)
515518
client.start()

0 commit comments

Comments
 (0)