Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Kirill Smelkov
wendelin.core
Commits
52bc8503
Commit
52bc8503
authored
Nov 26, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
8dc103eb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
5 deletions
+18
-5
wcfs/internal/_wcfs.pyx
wcfs/internal/_wcfs.pyx
+14
-2
wcfs/wcfs_test.py
wcfs/wcfs_test.py
+4
-3
No files found.
wcfs/internal/_wcfs.pyx
View file @
52bc8503
...
...
@@ -25,6 +25,7 @@
from
golang
cimport
chan
,
structZ
,
string
,
error
,
refptr
,
pychan
from
golang
cimport
context
from
golang
import
context
as
pycontext
from
libcpp
cimport
nullptr_t
,
nullptr
as
nil
from
libcpp.utility
cimport
pair
...
...
@@ -129,7 +130,14 @@ cdef class PyWatchLink:
if
err
.
eq
(
EOF
):
return
None
if
err
!=
nil
:
# XXX -> common place? support for other errors? is it good idea?
if
err
.
eq
(
context
.
canceled
):
raise
pycontext
.
canceled
if
err
.
eq
(
context
.
deadlineExceeded
):
raise
pycontext
.
deadlineExceeded
raise
RuntimeError
(
err
.
Error
())
# XXX exc class?
cdef
PyPinReq
pyreq
=
PyPinReq
.
__new__
(
PyPinReq
)
...
...
@@ -142,9 +150,13 @@ cdef class PyWatchLink:
reply
=
_
.
first
err
=
_
.
second
#printf("pyxsendReq: reply='%s'\n", reply.c_str())
if
err
!=
nil
:
# XXX -> common place? support for other errors? is it good idea?
if
err
.
eq
(
context
.
canceled
):
raise
pycontext
.
canceled
if
err
.
eq
(
context
.
deadlineExceeded
):
raise
pycontext
.
deadlineExceeded
raise
RuntimeError
(
err
.
Error
())
# XXX -> Xpy(err) ? pyraiseIf(err) ?
#printf("pyxsendReq: reply -> ok\n")
...
...
wcfs/wcfs_test.py
View file @
52bc8503
...
...
@@ -50,7 +50,7 @@ from golang import context, sync, time
from
zodbtools.util
import
ashex
as
h
,
fromhex
import
pytest
;
xfail
=
pytest
.
mark
.
xfail
from
pytest
import
raises
,
fail
from
six
import
reraise
#
from six import reraise
from
.internal
import
io
,
mm
from
.internal._wcfs
import
_tpywlinkwrite
as
_twlinkwrite
from
.internal.wcfs_test
import
_tDB
,
read_nogil
,
install_sigbus_trap
,
fadvise_dontneed
...
...
@@ -189,7 +189,7 @@ class DF:
dF
.
byfile
=
{}
# DFile represents a change to one file.
# it is
is
similar to ΔFile in wcfs.go .
# it is similar to ΔFile in wcfs.go .
class
DFile
:
# .rev tid
# .ddata {} blk -> data
...
...
@@ -951,7 +951,8 @@ def doCheckingPin(f, pinokByWLink, pinfunc=None): # -> []event(str)
except
Exception
as
e
:
if
e
is
context
.
canceled
:
return
# cancel is expected after f completes
reraise
(
e
,
None
,
e
.
__traceback__
)
#reraise(e, None, e.__traceback__)
raise
fail
(
"extra pin message received: %r"
%
req
.
msg
)
wg
.
go
(
_
,
wlink
,
zf
,
pinok
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment