Skip to content

Commit b380188

Browse files
committed
Recover better if we do not have a decompiler
1 parent 85280e7 commit b380188

1 file changed

Lines changed: 13 additions & 6 deletions

File tree

trepan/processor/command/deval.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*- coding: utf-8 -*-
2-
# Copyright (C) 2017-2018, 2020-2021, 2023 Rocky Bernstein
2+
# Copyright (C) 2017-2018, 2020-2021, 2023, 2025 Rocky Bernstein
33
#
44
# This program is free software: you can redistribute it and/or modify
55
# it under the terms of the GNU General Public License as published by
@@ -21,13 +21,20 @@
2121

2222
from trepan.processor.command.base_cmd import DebuggerCommand
2323

24+
have_decompiler = True
2425
if PYTHON_VERSION_TRIPLE >= (3, 9):
25-
pass
26+
have_decopmiler = False
2627
else:
27-
if (3, 7) <= PYTHON_VERSION_TRIPLE:
28-
from decompyle3.semantics.fragments import deparse_code, deparsed_find
29-
else:
30-
from uncompyle6.semantics.fragments import deparse_code, deparsed_find
28+
have_decompiler = True
29+
try:
30+
if (3, 7) <= PYTHON_VERSION_TRIPLE:
31+
from decompyle3.semantics.fragments import deparse_code, deparsed_find
32+
else:
33+
from uncompyle6.semantics.fragments import deparse_code, deparsed_find
34+
except Exception:
35+
have_decompiler = False
36+
37+
if have_decompiler:
3138

3239
class DEvalCommand(DebuggerCommand):
3340
"""**deval**

0 commit comments

Comments
 (0)