Commit 895b168c authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 2f662197
...@@ -46,7 +46,7 @@ from errno import EINVAL, ENOENT, ENOTCONN ...@@ -46,7 +46,7 @@ from errno import EINVAL, ENOENT, ENOTCONN
from stat import S_ISDIR from stat import S_ISDIR
from signal import SIGQUIT, SIGKILL from signal import SIGQUIT, SIGKILL
from golang import go, chan, select, func, defer, default from golang import go, chan, select, func, defer, default
from golang import context, sync, time from golang import context, errors, sync, time
from zodbtools.util import ashex as h, fromhex from zodbtools.util import ashex as h, fromhex
import pytest; xfail = pytest.mark.xfail import pytest; xfail = pytest.mark.xfail
from pytest import raises, fail from pytest import raises, fail
...@@ -948,7 +948,7 @@ def doCheckingPin(f, pinokByWLink, pinfunc=None): # -> []event(str) ...@@ -948,7 +948,7 @@ def doCheckingPin(f, pinokByWLink, pinfunc=None): # -> []event(str)
try: try:
req = wlink.recvReq(ctx) req = wlink.recvReq(ctx)
except Exception as e: except Exception as e:
if e is context.canceled: # XXX -> errors.Is if errors.Is(e, context.canceled):
return # cancel is expected after f completes return # cancel is expected after f completes
raise raise
...@@ -1984,7 +1984,7 @@ def procwait_(ctx, proc): # -> ok ...@@ -1984,7 +1984,7 @@ def procwait_(ctx, proc): # -> ok
try: try:
procwait(ctx, proc) procwait(ctx, proc)
except Exception as e: except Exception as e:
if e in (context.canceled, context.deadlineExceeded): # XXX -> errors.Is if errors.Is(e, context.canceled) or errors.Is(e, context.deadlineExceeded):
return False return False
raise raise
return True return True
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment