fix _dexdump_found() in test_scanner.py !1621

find_sdk_tools_cmd() will throw an exception if it can't find the tool, not
return None.
This commit is contained in:
Hans-Christoph Steiner 2025-03-21 10:32:08 +01:00
parent 0b192a7694
commit 58609aa9f0

View file

@ -23,6 +23,7 @@ import yaml
import fdroidserver.build
import fdroidserver.common
import fdroidserver.exception
import fdroidserver.metadata
import fdroidserver.scanner
from .shared_test_code import TmpCwd, mkdtemp, mock_open_to_str
@ -36,9 +37,13 @@ def _dexdump_found():
This must be run after common.config is setup.
"""
dexdump = fdroidserver.common.find_sdk_tools_cmd("dexdump")
logging.debug('Found dexdump: %s', dexdump)
return dexdump is not None
try:
dexdump = fdroidserver.common.find_sdk_tools_cmd("dexdump")
logging.debug('Found dexdump: %s', dexdump)
return dexdump is not None
except fdroidserver.exception.FDroidException:
pass
return False
# Always use built-in default rules so changes in downloaded rules don't break tests.