Przeglądaj źródła

Avoid unnecessary re-opening of index files during pack close.

Jelmer Vernooij 11 lat temu
rodzic
commit
3e8799a271
1 zmienionych plików z 2 dodań i 1 usunięć
  1. 2 1
      dulwich/pack.py

+ 2 - 1
dulwich/pack.py

@@ -1802,7 +1802,8 @@ class Pack(object):
     def close(self):
         if self._data is not None:
             self._data.close()
-        self.index.close()
+        if self._idx is not None:
+            self._idx.close()
 
     def __eq__(self, other):
         return type(self) == type(other) and self.index == other.index