You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-02 16:44:46 +08:00
Better handling of bytecode errors
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
#
|
||||
from __future__ import print_function
|
||||
import sys, os, getopt, time
|
||||
from xdis.version_info import version_tuple_to_str
|
||||
|
||||
program = 'uncompyle6'
|
||||
|
||||
@@ -76,8 +77,10 @@ def main_bin():
|
||||
(3, 4), (3, 5), (3, 6),
|
||||
(3, 7), (3, 8), (3, 9), (3, 10)
|
||||
)):
|
||||
print('Error: %s requires Python 2.4-3.10' % program,
|
||||
file=sys.stderr)
|
||||
print(
|
||||
f"Error: {program} can decompile only bytecode from Python 3.7"
|
||||
f""" to 3.8.\n\tYou have version: {version_tuple_to_str()}."""
|
||||
)
|
||||
sys.exit(-1)
|
||||
|
||||
do_verify = recurse_dirs = False
|
||||
@@ -197,6 +200,9 @@ def main_bin():
|
||||
mess = status_msg(do_verify, *result)
|
||||
print('# ' + mess)
|
||||
pass
|
||||
except ImportError as e:
|
||||
print(str(e))
|
||||
sys.exit(2)
|
||||
except (KeyboardInterrupt):
|
||||
pass
|
||||
except verify.VerifyCmpError:
|
||||
|
Reference in New Issue
Block a user