Commit 75c9a868 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 895b168c
......@@ -25,8 +25,7 @@
# Package _wcfs provides Python-wrappers for C++ wcfs client package.
# See _wcfs.pxd for package overview.
from golang cimport pychan, nil
from golang import context as pycontext
from golang cimport pychan, pyerror, nil
cdef extern from *:
ctypedef bint cbool "bool"
......@@ -265,15 +264,7 @@ def _tpywlinkwrite(PyWatchLink pywlink, bytes pypkt):
cdef object pyerr(error err):
if err == nil:
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):
return pycontext.deadlineExceeded
return RuntimeError(err.Error()) # XXX exc class ok?
return pyerror.from_error(err)
from golang cimport topyexc
......
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