Handle nested multierror case on windows

immediate_remote_cancels
Tyler Goodlet 2021-10-15 09:16:51 -04:00
parent 51259c4809
commit 533457c64d
1 changed files with 7 additions and 3 deletions

View File

@ -1,5 +1,6 @@
""" """
Cancellation and error propagation Cancellation and error propagation
""" """
import os import os
import signal import signal
@ -377,10 +378,13 @@ async def test_nested_multierrors(loglevel, start_method):
elif isinstance(subexc, trio.MultiError): elif isinstance(subexc, trio.MultiError):
for subsub in subexc.exceptions: for subsub in subexc.exceptions:
assert subsub.type in (
tractor.RemoteActorError, if subsub in (tractor.RemoteActorError,):
subsub = subsub.type
assert subsub in (
trio.Cancelled, trio.Cancelled,
trio.MultiError trio.MultiError,
) )
else: else:
assert isinstance(subexc, tractor.RemoteActorError) assert isinstance(subexc, tractor.RemoteActorError)