소스 검색

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

Jelmer Vernooij 11 년 전
부모
커밋
3e8799a271
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  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