Skip to content

Commit 32b63b1

Browse files
committed
On 3.{7,8} allow having only decompyle3 installed
1 parent c33e111 commit 32b63b1

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

trepan/processor/command/deparse.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,19 @@
1414
# You should have received a copy of the GNU General Public License
1515
# along with this program. If not, see <http://www.gnu.org/licenses/>.
1616

17+
import sys
18+
19+
if (3, 7) <= sys.version_info[:2] <= (3, 8):
20+
try:
21+
from decompyle3.semantics.fragments import code_deparse
22+
except ImportError:
23+
from uncompyle6.semantics.fragments import code_deparse
24+
else:
25+
from uncompyle6.semantics.fragments import code_deparse
26+
1727
from getopt import getopt, GetoptError
18-
from uncompyle6.semantics.fragments import code_deparse
28+
29+
1930
from trepan.lib.deparse import deparse_and_cache, deparse_offset
2031
from pyficache import highlight_string, getlines
2132

0 commit comments

Comments
 (0)