Commit 3d27ed5d authored by Kirill Smelkov's avatar Kirill Smelkov

go/zodb, go/zodb/btree: Fix go generate after rename on zodbtools side

run_with_zodb3py2_compat was renamed to run_with_zodb4py2_compat in
nexedi/zodbtools@c59a54ca .

Without the fix go genrate was failing as

    (neo) (z-dev) (g.env) kirr@deca:~/src/neo/src/lab.nexedi.com/kirr/neo/go/zodb/btree$ go generate
    Traceback (most recent call last):
      File "./testdata/gen-testdata", line 26, in <module>
        from zodbtools.test.gen_testdata import run_with_zodb3py2_compat
    ImportError: cannot import name run_with_zodb3py2_compat

and

    (neo) (z-dev) (g.env) kirr@deca:~/src/neo/src/lab.nexedi.com/kirr/neo/go/zodb$ go generate
    Traceback (most recent call last):
      File "./py/pydata-gen-testdata", line 24, in <module>
        from zodbtools.test.gen_testdata import run_with_zodb3py2_compat
    ImportError: cannot import name run_with_zodb3py2_compat

This amends commit fc69e00d (go/zodb/fs1: Fix Python database generator
to work with recent zodbtools).
parent bc3b5ec3
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
# Copyright (C) 2018-2020 Nexedi SA and Contributors.
# Copyright (C) 2018-2021 Nexedi SA and Contributors.
# Kirill Smelkov <kirr@nexedi.com>
#
# This program is free software: you can Use, Study, Modify and Redistribute
......@@ -23,7 +23,7 @@
from ZODB.DB import DB
from BTrees.LOBTree import LOBucket, LOBTree
from ZODB.utils import u64
from zodbtools.test.gen_testdata import run_with_zodb3py2_compat
from zodbtools.test.gen_testdata import run_with_zodb4py2_compat
import os, os.path, transaction
from golang.gcompat import qq
......@@ -89,7 +89,7 @@ def main2():
db.close()
def main():
run_with_zodb3py2_compat(main2)
run_with_zodb4py2_compat(main2)
if __name__ == '__main__':
......
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
# Copyright (C) 2017-2020 Nexedi SA and Contributors.
# Copyright (C) 2017-2021 Nexedi SA and Contributors.
# Kirill Smelkov <kirr@nexedi.com>
#
# This program is free software: you can Use, Study, Modify and Redistribute
......@@ -21,7 +21,7 @@
"""generate reference pickle objects encoding for tests"""
from ZODB import serialize
from zodbtools.test.gen_testdata import run_with_zodb3py2_compat
from zodbtools.test.gen_testdata import run_with_zodb4py2_compat
from golang.gcompat import qq
def main2():
......@@ -56,7 +56,7 @@ def main2():
emit("}")
def main():
run_with_zodb3py2_compat(main2)
run_with_zodb4py2_compat(main2)
if __name__ == '__main__':
main()
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