Commit 6ec07094 authored by Barry Warsaw's avatar Barry Warsaw

_initroot(): Since we have the ZERO global, we might as well use it.

parent 894b7ee4
...@@ -105,7 +105,7 @@ class PackableStorageBase: ...@@ -105,7 +105,7 @@ class PackableStorageBase:
class PackableStorage(PackableStorageBase): class PackableStorage(PackableStorageBase):
def _initroot(self): def _initroot(self):
try: try:
self._storage.load('\0\0\0\0\0\0\0\0','') self._storage.load(ZERO, '')
except KeyError: except KeyError:
import PersistentMapping import PersistentMapping
from ZODB.Transaction import Transaction from ZODB.Transaction import Transaction
...@@ -116,8 +116,7 @@ class PackableStorage(PackableStorageBase): ...@@ -116,8 +116,7 @@ class PackableStorage(PackableStorageBase):
t=Transaction() t=Transaction()
t.description='initial database creation' t.description='initial database creation'
self._storage.tpc_begin(t) self._storage.tpc_begin(t)
self._storage.store('\0\0\0\0\0\0\0\0', self._storage.store(ZERO, None, file.getvalue(), '', t)
None, file.getvalue(), '', t)
self._storage.tpc_vote(t) self._storage.tpc_vote(t)
self._storage.tpc_finish(t) self._storage.tpc_finish(t)
......
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