Commit f50447a9 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent f37de13c
...@@ -23,6 +23,7 @@ package main ...@@ -23,6 +23,7 @@ package main
import ( import (
//"context" //"context"
"fmt"
"reflect" "reflect"
"lab.nexedi.com/kirr/neo/go/zodb" "lab.nexedi.com/kirr/neo/go/zodb"
...@@ -51,7 +52,7 @@ func (zb *zBlk0State) DropState() { ...@@ -51,7 +52,7 @@ func (zb *zBlk0State) DropState() {
func (zb *zBlk0State) PySetState(pystate interface{}) error { func (zb *zBlk0State) PySetState(pystate interface{}) error {
blkdata, ok := pystate.(string) blkdata, ok := pystate.(string)
if !ok { if !ok {
// XXX return fmt.Errorf("expect str; got %T", pystate)
} }
zb.blkdata = blkdata zb.blkdata = blkdata
...@@ -76,7 +77,7 @@ func (zd *zDataState) DropState() { ...@@ -76,7 +77,7 @@ func (zd *zDataState) DropState() {
func (zd *zDataState) PySetState(pystate interface{}) error { func (zd *zDataState) PySetState(pystate interface{}) error {
data, ok := pystate.(string) data, ok := pystate.(string)
if !ok { if !ok {
// XXX return fmt.Errorf("expect str; got %T", pystate)
} }
zd.data = data zd.data = data
...@@ -99,7 +100,7 @@ func (zb *zBlk1State) DropState() { ...@@ -99,7 +100,7 @@ func (zb *zBlk1State) DropState() {
func (zb *zBlk1State) PySetState(pystate interface{}) error { func (zb *zBlk1State) PySetState(pystate interface{}) error {
chunktab, ok := pystate.(*btree.BTree) chunktab, ok := pystate.(*btree.BTree)
if !ok { if !ok {
// XXX return fmt.Errorf("expect BTree; got %T", pystate)
} }
zb.chunktab = chunktab zb.chunktab = chunktab
...@@ -135,18 +136,21 @@ func (bf *zBigFileState) PySetState(pystate interface{}) (err error) { ...@@ -135,18 +136,21 @@ func (bf *zBigFileState) PySetState(pystate interface{}) (err error) {
// state: (.blksize, .blktab) // state: (.blksize, .blktab)
t, ok := pystate.(pickle.Tuple) t, ok := pystate.(pickle.Tuple)
if !ok || len(t) != 2 { if !ok {
// XXX return fmt.Errorf("expect [2](); got %T", pystate)
}
if len(t) != 2 {
return fmt.Errorf("expect [2](); got [%d]()", len(t))
} }
// blksize, ok := pickletools.Xint64(t[0]) // XXX reenable (pickletools) // blksize, ok := pickletools.Xint64(t[0]) // XXX reenable (pickletools)
if !ok { if !ok {
// XXX return fmt.Errorf("blksize: expect integer; got %T", t[0])
} }
blktab, ok := t[1].(*btree.BTree) blktab, ok := t[1].(*btree.BTree)
if !ok { if !ok {
// XXX return fmt.Errorf("blktab: expect BTree; got %T", t[1])
} }
bf.blksize = 0 // XXX blksize bf.blksize = 0 // XXX blksize
......
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