mirror of
https://github.com/avast/retdec.git
synced 2024-11-23 21:10:13 +00:00
Do not fail complately when retdec-archive-decompiler is not available
This commit is contained in:
parent
f4da38081f
commit
3f6ba3a2c4
@ -15,10 +15,12 @@ import sys
|
||||
utils = importlib.import_module('retdec-utils')
|
||||
utils.check_python_version()
|
||||
utils.ensure_script_is_being_run_from_installed_retdec()
|
||||
retdec_archive_decompiler = importlib.import_module('retdec-archive-decompiler')
|
||||
|
||||
ArchiveDecompiler = retdec_archive_decompiler.ArchiveDecompiler
|
||||
|
||||
try:
|
||||
retdec_archive_decompiler = importlib.import_module('retdec-archive-decompiler')
|
||||
ArchiveDecompiler = retdec_archive_decompiler.ArchiveDecompiler
|
||||
except ImportError:
|
||||
ArchiveDecompiler = None
|
||||
|
||||
sys.stdout = utils.Unbuffered(sys.stdout)
|
||||
|
||||
@ -78,6 +80,7 @@ def main():
|
||||
if args.json:
|
||||
archive_decompiler_args.append('--json')
|
||||
|
||||
assert ArchiveDecompiler is not None, "You need to install RetDec with Decompiler in order to analyze archives"
|
||||
decompiler = ArchiveDecompiler(archive_decompiler_args)
|
||||
sys.exit(decompiler.decompile_archive())
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user