Commit bb8587da authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent d29b0dae
...@@ -267,6 +267,7 @@ cdef object pyerr(error err): ...@@ -267,6 +267,7 @@ cdef object pyerr(error err):
return None return None
# XXX support for other errors? is it good idea? # XXX support for other errors? is it good idea?
# XXX -> errors.Is ?
if err.eq(context.canceled): if err.eq(context.canceled):
return pycontext.canceled return pycontext.canceled
if err.eq(context.deadlineExceeded): if err.eq(context.deadlineExceeded):
......
...@@ -130,7 +130,7 @@ error _Conn::close() { ...@@ -130,7 +130,7 @@ error _Conn::close() {
reterr1(err); reterr1(err);
wconn._pinCancel(); wconn._pinCancel();
err = wconn._pinWG->wait(); err = wconn._pinWG->wait();
if (err != context::canceled) // canceled - ok XXX check ok? if (!errors::Is(err, context::canceled)) // canceled - ok
reterr1(err); reterr1(err);
// close all files - both that have no mappings and that still have opened mappings. // close all files - both that have no mappings and that still have opened mappings.
......
...@@ -51,10 +51,6 @@ using std::tie; ...@@ -51,10 +51,6 @@ using std::tie;
using std::vector; using std::vector;
// nil is synonym for nullptr and NULL. XXX -> pygolang
const nullptr_t nil = nullptr;
// io:: XXX -> pygolang // io:: XXX -> pygolang
namespace io { namespace io {
......
...@@ -101,7 +101,7 @@ error _WatchLink::close() { ...@@ -101,7 +101,7 @@ error _WatchLink::close() {
// XXX -> we now have `kill -QUIT` to wcfs.go on test timeout - remove ^^^ comments? // XXX -> we now have `kill -QUIT` to wcfs.go on test timeout - remove ^^^ comments?
error err2 = wlink._serveWG->wait(); error err2 = wlink._serveWG->wait();
// canceled is expected and ok // 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; err2 = nil;
error err3 = wlink._f->close(); error err3 = wlink._f->close();
......
...@@ -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: if e is context.canceled: # XXX -> errors.Is
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): if e in (context.canceled, context.deadlineExceeded): # XXX -> errors.Is
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