Skip to content

Commit

Permalink
Revise pydisasm version checking
Browse files Browse the repository at this point in the history
  • Loading branch information
rocky committed Oct 15, 2021
1 parent ffd2d2f commit a258680
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions xdis/bin/pydisasm.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,15 @@ def main(format, files):
the Python interpreter used to run this program. For example, you can disassemble Python 3.6.9
bytecode from Python 2.7.15 and vice versa.
"""
if not ((2, 7) <= PYTHON_VERSION_TRIPLE < (3, 11)):
if (2, 4) <= PYTHON_VERSION_TRIPLE <= (2, 6):
sys.stderr.write(
"This code works on 2.7 to 3.10. code that works for %s can be found in the python-2.4 branch\n"
% PYTHON_VERSION_STR
)
sys.exit(1)
sys.stderr.write(
"This works on Python version 2.7 to 3.10; have %s.\n" % PYTHON_VERSION_STR
)
if not ((2, 7) <= PYTHON_VERSION_TRIPLE < (3, 12)):
mess = "This code works on 3.6 to 3.12."
if (2, 4) <= PYTHON_VERSION_TRIPLE <= (2, 7):
mess += " Code that works for %s can be found in the python-2.4 branch\n"
elif (3, 1) <= PYTHON_VERSION_TRIPLE <= (3, 2):
mess += " Code that works for %s can be found in the python-3.1 branch\n"
elif (3, 3) <= PYTHON_VERSION_TRIPLE <= (3, 5):
mess += " Code that works for %s can be found in the python-3.3 branch\n"
sys.stderr.write(mess % PYTHONVERSION_STR)
sys.exit(2)

for path in files:
Expand Down

0 comments on commit a258680

Please sign in to comment.