@@ -129,7 +129,7 @@ def read(self):
129129 self .built_value = self .value
130130 return self .built_value
131131
132- def get_text_contents (self ):
132+ def get_text_contents (self ) -> str :
133133 """By the assumption that the node.built_value is a
134134 deterministic product of the sources, the contents of a Value
135135 are the concatenation of all the contents of its sources. As
@@ -141,24 +141,16 @@ def get_text_contents(self):
141141 contents = contents + kid .get_contents ().decode ()
142142 return contents
143143
144- def get_contents (self ):
145- """
146- Get contents for signature calculations.
147- :return: bytes
148- """
149- text_contents = self .get_text_contents ()
150- try :
151- return text_contents .encode ()
152- except UnicodeDecodeError :
153- # Already encoded as python2 str are bytes
154- return text_contents
144+ def get_contents (self ) -> bytes :
145+ """Get contents for signature calculations."""
146+ return self .get_text_contents ().encode ()
155147
156148 def changed_since_last_build (self , target , prev_ni ):
157149 cur_csig = self .get_csig ()
158150 try :
159151 return cur_csig != prev_ni .csig
160152 except AttributeError :
161- return 1
153+ return True
162154
163155 def get_csig (self , calc = None ):
164156 """Because we're a Python value node and don't have a real
0 commit comments