]> arthur.barton.de Git - bup.git/commitdiff
PackWriter init: initialize file guard first
authorRob Browning <rlb@defaultvalue.org>
Sun, 3 Jan 2016 17:42:27 +0000 (11:42 -0600)
committerRob Browning <rlb@defaultvalue.org>
Mon, 18 Jan 2016 17:29:52 +0000 (11:29 -0600)
Initialize the self.file variable first since it's used to test the
state of the object.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
lib/bup/git.py

index 38dbc3158e62c726ded54a893c01567caa7417e7..5710f054515be18ac3e77d5172edb1b7b609fb5c 100644 (file)
@@ -567,10 +567,10 @@ def _make_objcache():
 class PackWriter:
     """Writes Git objects inside a pack file."""
     def __init__(self, objcache_maker=_make_objcache, compression_level=1):
+        self.file = None
         self.count = 0
         self.outbytes = 0
         self.filename = None
-        self.file = None
         self.idx = None
         self.objcache_maker = objcache_maker
         self.objcache = None