Browse Source

Avoid using msgpack.packb at import time.

move item_keys = ... to __init__ (self.item_keys = ...)

Solution from/discussed with TW.
Björn Ketelaars 9 years ago
parent
commit
e6911b2f25
1 changed files with 1 additions and 2 deletions
  1. 1 2
      borg/archive.py

+ 1 - 2
borg/archive.py

@@ -605,10 +605,9 @@ ITEM_KEYS = set([b'path', b'source', b'rdev', b'chunks',
 class RobustUnpacker:
     """A restartable/robust version of the streaming msgpack unpacker
     """
-    item_keys = [msgpack.packb(name) for name in ITEM_KEYS]
-
     def __init__(self, validator):
         super().__init__()
+        self.item_keys = [msgpack.packb(name) for name in ITEM_KEYS]
         self.validator = validator
         self._buffered_data = []
         self._resync = False