Explorar o código

Always initialize _sha.

Jelmer Vernooij %!s(int64=16) %!d(string=hai) anos
pai
achega
603cd5a5dd
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      dulwich/objects.py

+ 3 - 0
dulwich/objects.py

@@ -158,6 +158,7 @@ class ShaFile(object):
   
     def __init__(self):
         """Don't call this directly"""
+        self._sha = None
   
     def _parse_text(self):
         """For subclasses to do initialisation time parsing"""
@@ -386,6 +387,7 @@ class Tree(ShaFile):
     _num_type = 2
 
     def __init__(self):
+        super(Tree, self).__init__()
         self._entries = {}
         self._needs_parsing = False
         self._needs_serialization = True
@@ -475,6 +477,7 @@ class Commit(ShaFile):
     _num_type = 1
 
     def __init__(self):
+        super(Commit, self).__init__()
         self._parents = []
         self._needs_parsing = False
         self._needs_serialization = True