aboutsummaryrefslogtreecommitdiff
path: root/contrib/devtools/symbol-check.py
diff options
context:
space:
mode:
authorfanquake <fanquake@gmail.com>2020-11-22 11:32:55 +0800
committerfanquake <fanquake@gmail.com>2020-12-28 14:25:06 +0800
commit1ef2138c0db3bd4f9332c777fa3fb2770dc1b08c (patch)
tree3faeca0a36f00c9aa46afe4c7e4495d1955ba576 /contrib/devtools/symbol-check.py
parent4a8f4ac4fc07c59a0bfdbb7c15a50cf5b4364312 (diff)
downloadbitcoin-1ef2138c0db3bd4f9332c777fa3fb2770dc1b08c.tar.xz
lint: run mypy over contrib/devtools
Diffstat (limited to 'contrib/devtools/symbol-check.py')
-rwxr-xr-xcontrib/devtools/symbol-check.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/contrib/devtools/symbol-check.py b/contrib/devtools/symbol-check.py
index 91c7e32578..b30ed62521 100755
--- a/contrib/devtools/symbol-check.py
+++ b/contrib/devtools/symbol-check.py
@@ -157,7 +157,7 @@ def check_version(max_versions, version, arch) -> bool:
def check_imported_symbols(filename) -> bool:
elf = pixie.load(filename)
cppfilt = CPPFilt()
- ok = True
+ ok: bool = True
for symbol in elf.dyn_symbols:
if not symbol.is_import:
@@ -172,7 +172,7 @@ def check_imported_symbols(filename) -> bool:
def check_exported_symbols(filename) -> bool:
elf = pixie.load(filename)
cppfilt = CPPFilt()
- ok = True
+ ok: bool = True
for symbol in elf.dyn_symbols:
if not symbol.is_export:
continue
@@ -184,7 +184,7 @@ def check_exported_symbols(filename) -> bool:
return ok
def check_ELF_libraries(filename) -> bool:
- ok = True
+ ok: bool = True
elf = pixie.load(filename)
for library_name in elf.query_dyn_tags(pixie.DT_NEEDED):
assert(isinstance(library_name, bytes))
@@ -207,7 +207,7 @@ def macho_read_libraries(filename) -> List[str]:
return libraries
def check_MACHO_libraries(filename) -> bool:
- ok = True
+ ok: bool = True
for dylib in macho_read_libraries(filename):
if dylib not in MACHO_ALLOWED_LIBRARIES:
print('{} is not in ALLOWED_LIBRARIES!'.format(dylib))
@@ -227,7 +227,7 @@ def pe_read_libraries(filename) -> List[str]:
return libraries
def check_PE_libraries(filename) -> bool:
- ok = True
+ ok: bool = True
for dylib in pe_read_libraries(filename):
if dylib not in PE_ALLOWED_LIBRARIES:
print('{} is not in ALLOWED_LIBRARIES!'.format(dylib))
@@ -260,7 +260,7 @@ def identify_executable(executable) -> Optional[str]:
return None
if __name__ == '__main__':
- retval = 0
+ retval: int = 0
for filename in sys.argv[1:]:
try:
etype = identify_executable(filename)
@@ -269,7 +269,7 @@ if __name__ == '__main__':
retval = 1
continue
- failed = []
+ failed: List[str] = []
for (name, func) in CHECKS[etype]:
if not func(filename):
failed.append(name)