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
b14154b6
Commit
b14154b6
authored
Sep 30, 2018
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
3c1c9f41
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
1 deletion
+28
-1
wcfs/internal/pycompat/pycompat.go
wcfs/internal/pycompat/pycompat.go
+25
-0
wcfs/zblk.go
wcfs/zblk.go
+3
-1
No files found.
wcfs/internal/pycompat/pycompat.go
0 → 100644
View file @
b14154b6
// XXX dup from neo/go/zodb/internal/pickletools
package
pycompat
import
(
"math/big"
)
// Int64 tries to convert unpickled Python value to int64.
//
// (ogórek decodes python long as big.Int)
//
// XXX + support for float?
func
Int64
(
xv
interface
{})
(
v
int64
,
ok
bool
)
{
switch
v
:=
xv
.
(
type
)
{
case
int64
:
return
v
,
true
case
*
big
.
Int
:
if
v
.
IsInt64
()
{
return
v
.
Int64
(),
true
}
}
return
0
,
false
}
wcfs/zblk.go
View file @
b14154b6
...
...
@@ -34,6 +34,8 @@ import (
"lab.nexedi.com/kirr/neo/go/zodb"
"lab.nexedi.com/kirr/neo/go/zodb/btree"
pickle
"github.com/kisielk/og-rek"
"./internal/pycompat"
)
// module of Wendelin ZODB py objects
...
...
@@ -319,7 +321,7 @@ func (bf *zBigFileState) PySetState(pystate interface{}) (err error) {
return
fmt
.
Errorf
(
"expect [2](); got [%d]()"
,
len
(
t
))
}
blksize
,
ok
:=
zodbpickle
.
Xint64
(
t
[
0
])
// XXX reenable (pickletools
)
blksize
,
ok
:=
pycompat
.
Int64
(
t
[
0
]
)
if
!
ok
{
return
fmt
.
Errorf
(
"blksize: expect integer; got %T"
,
t
[
0
])
}
...
...
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