Commit bb8587da authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent d29b0dae
......@@ -267,6 +267,7 @@ cdef object pyerr(error err):
return None
# XXX support for other errors? is it good idea?
# XXX -> errors.Is ?
if err.eq(context.canceled):
return pycontext.canceled
if err.eq(context.deadlineExceeded):
......
......@@ -130,7 +130,7 @@ error _Conn::close() {
reterr1(err);
wconn._pinCancel();
err = wconn._pinWG->wait();
if (err != context::canceled) // canceled - ok XXX check ok?
if (!errors::Is(err, context::canceled)) // canceled - ok
reterr1(err);
// close all files - both that have no mappings and that still have opened mappings.
......
......@@ -51,10 +51,6 @@ using std::tie;
using std::vector;
// nil is synonym for nullptr and NULL. XXX -> pygolang
const nullptr_t nil = nullptr;
// io:: XXX -> pygolang
namespace io {
......
......@@ -101,7 +101,7 @@ error _WatchLink::close() {
// XXX -> we now have `kill -QUIT` to wcfs.go on test timeout - remove ^^^ comments?
error err2 = wlink._serveWG->wait();
// canceled is expected and ok
if (err2 == context::canceled) // FIXME -> errors.Cause(err2) | errors.Is(err2, context::canceled)
if (errors.Is(err2, context::canceled))
err2 = nil;
error err3 = wlink._f->close();
......
......@@ -948,7 +948,7 @@ def doCheckingPin(f, pinokByWLink, pinfunc=None): # -> []event(str)
try:
req = wlink.recvReq(ctx)
except Exception as e:
if e is context.canceled:
if e is context.canceled: # XXX -> errors.Is
return # cancel is expected after f completes
raise
......@@ -1984,7 +1984,7 @@ def procwait_(ctx, proc): # -> ok
try:
procwait(ctx, proc)
except Exception as e:
if e in (context.canceled, context.deadlineExceeded):
if e in (context.canceled, context.deadlineExceeded): # XXX -> errors.Is
return False
raise
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