Fix manifest_fixer.py warnings

Fix a few warnings showing up in manifest_*.py

Test: manifest_fixer_test.py
Test: manifest_check_test.py
Flag: EXEMPT refactor
Change-Id: I144100d6d4aa7f5dff7eec79b4bd2d9d5da52153
This commit is contained in:
Colin Cross
2024-09-11 11:34:35 -07:00
parent aa8ceca851
commit 6cb462b38c
5 changed files with 74 additions and 68 deletions

View File

@@ -122,7 +122,7 @@ def enforce_uses_libraries(manifest, required, optional, missing_optional, relax
# handles module names specified in Android.bp properties. However not all
# <uses-library> entries in the manifest correspond to real modules: some of
# the optional libraries may be missing at build time. Therefor this script
# accepts raw module names as spelled in Android.bp/Amdroid.mk and trims the
# accepts raw module names as spelled in Android.bp/Android.mk and trims the
# optional namespace part manually.
required = trim_namespace_parts(required)
optional = trim_namespace_parts(optional)
@@ -266,7 +266,7 @@ def extract_target_sdk_version(manifest, is_apk=False):
manifest: manifest (either parsed XML or aapt dump of APK)
is_apk: if the manifest comes from an APK or an XML file
"""
if is_apk: #pylint: disable=no-else-return
if is_apk: #pylint: disable=no-else-return
return extract_target_sdk_version_apk(manifest)
else:
return extract_target_sdk_version_xml(manifest)
@@ -376,7 +376,7 @@ def main():
# Create a status file that is empty on success, or contains an
# error message on failure. When exceptions are suppressed,
# dexpreopt command command will check file size to determine if
# dexpreopt command will check file size to determine if
# the check has failed.
if args.enforce_uses_libraries_status:
with open(args.enforce_uses_libraries_status, 'w') as f:
@@ -386,7 +386,7 @@ def main():
if args.extract_target_sdk_version:
try:
print(extract_target_sdk_version(manifest, is_apk))
except: #pylint: disable=bare-except
except: #pylint: disable=bare-except
# Failed; don't crash, return "any" SDK version. This will
# result in dexpreopt not adding any compatibility libraries.
print(10000)