Skip to content

Commit

Permalink
Do not fail complately when retdec-archive-decompiler is not available
Browse files Browse the repository at this point in the history
  • Loading branch information
metthal committed Jan 8, 2021
1 parent da1c736 commit 2884d09
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions scripts/retdec-fileinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@
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)

Expand Down Expand Up @@ -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())

Expand Down

0 comments on commit 2884d09

Please sign in to comment.