@@ -157,7 +157,7 @@ def check_version(max_versions, version, arch) -> bool:
157157def check_imported_symbols (filename ) -> bool :
158158 elf = pixie .load (filename )
159159 cppfilt = CPPFilt ()
160- ok = True
160+ ok : bool = True
161161
162162 for symbol in elf .dyn_symbols :
163163 if not symbol .is_import :
@@ -172,7 +172,7 @@ def check_imported_symbols(filename) -> bool:
172172def check_exported_symbols (filename ) -> bool :
173173 elf = pixie .load (filename )
174174 cppfilt = CPPFilt ()
175- ok = True
175+ ok : bool = True
176176 for symbol in elf .dyn_symbols :
177177 if not symbol .is_export :
178178 continue
@@ -184,7 +184,7 @@ def check_exported_symbols(filename) -> bool:
184184 return ok
185185
186186def check_ELF_libraries (filename ) -> bool :
187- ok = True
187+ ok : bool = True
188188 elf = pixie .load (filename )
189189 for library_name in elf .query_dyn_tags (pixie .DT_NEEDED ):
190190 assert (isinstance (library_name , bytes ))
@@ -207,7 +207,7 @@ def macho_read_libraries(filename) -> List[str]:
207207 return libraries
208208
209209def check_MACHO_libraries (filename ) -> bool :
210- ok = True
210+ ok : bool = True
211211 for dylib in macho_read_libraries (filename ):
212212 if dylib not in MACHO_ALLOWED_LIBRARIES :
213213 print ('{} is not in ALLOWED_LIBRARIES!' .format (dylib ))
@@ -227,7 +227,7 @@ def pe_read_libraries(filename) -> List[str]:
227227 return libraries
228228
229229def check_PE_libraries (filename ) -> bool :
230- ok = True
230+ ok : bool = True
231231 for dylib in pe_read_libraries (filename ):
232232 if dylib not in PE_ALLOWED_LIBRARIES :
233233 print ('{} is not in ALLOWED_LIBRARIES!' .format (dylib ))
@@ -260,7 +260,7 @@ def identify_executable(executable) -> Optional[str]:
260260 return None
261261
262262if __name__ == '__main__' :
263- retval = 0
263+ retval : int = 0
264264 for filename in sys .argv [1 :]:
265265 try :
266266 etype = identify_executable (filename )
@@ -269,7 +269,7 @@ def identify_executable(executable) -> Optional[str]:
269269 retval = 1
270270 continue
271271
272- failed = []
272+ failed : List [ str ] = []
273273 for (name , func ) in CHECKS [etype ]:
274274 if not func (filename ):
275275 failed .append (name )
0 commit comments