* xasm format fixes * more Python version tuple compare conversions * add version_str_to_tuple() to convert the other way. This is useful in xasm, for example. * Reduce PYTHON_VERSION usage in xdis. * Allow optional delimiter and start length in version_tuple_to_str() * fix logic bug in setting MAGIC * Add a little Python 3.8.5 Graal (Java VM) knowledge. * Add PyPy 3.8 opcodes and disassembly * Accept Python 3.8.12 * Fix some small lingering bugs introduced converting Python version number floats to tuples * Reworked for Python 3.10. * Add 3.10 opcodes. * Add 3.9 and 3.10 testing. * Some tolerance for running from 3.11 * Update magic numbers * Expanding testing to include pyston and PyPy 3.7 * Added knowledge of Python versions 3.6.15 and 3.7.12. * Restrict wheel packaging for Python 3 only. * Use the wheel for only the 3.x and newer version of Python. * Add Python version 3.9.7 * Document unmarshal better * Correct stack information for IMPORT_NAME * Fix bug in code type handling where bytes were showing up as strings * More type annotations in master branch. Create more older variations without annotations * Add Python versions 3.9.6, 3.7.11, 3.8.11, and 3.6.14 * Note Python versions 3.8.10 and 3.9.5 * Incorrect variable name in marshal dump (used in writting .pyc files). PR #77 * Improve 3.9 IS_OP and CONTAINS_OP operand formatting * Correct disassembly of 3.9 bytecode from other bytecode OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-xdis?expand=0&rev=32
38 lines
1.6 KiB
Diff
38 lines
1.6 KiB
Diff
Remove power from the folks who brought you linux2
|
|
Index: python-xdis-6.0.3/xdis/version_info.py
|
|
===================================================================
|
|
--- python-xdis-6.0.3.orig/xdis/version_info.py
|
|
+++ python-xdis-6.0.3/xdis/version_info.py
|
|
@@ -36,7 +36,7 @@ PYTHON_VERSION_STR = "%s.%s" % (sys.vers
|
|
|
|
IS_PYPY = "__pypy__" in sys.builtin_module_names
|
|
|
|
-def version_tuple_to_str(version_tuple=PYTHON_VERSION_TRIPLE, start=0, end=3, delimiter=".") -> str:
|
|
+def version_tuple_to_str(version_tuple=PYTHON_VERSION_TRIPLE, start=0, end=2, delimiter=".") -> str:
|
|
"""
|
|
Turn a version tuple, e.g. (3,2,6), into a dotted string, e.g. "3.2.6".
|
|
|
|
Index: python-xdis-6.0.3/xdis/disasm.py
|
|
===================================================================
|
|
--- python-xdis-6.0.3.orig/xdis/disasm.py
|
|
+++ python-xdis-6.0.3/xdis/disasm.py
|
|
@@ -39,6 +39,7 @@ from xdis.op_imports import op_imports,
|
|
def get_opcode(version_tuple, is_pypy, alternate_opmap=None):
|
|
# Set up disassembler with the right opcodes
|
|
lookup = ".".join((str(i) for i in version_tuple))
|
|
+ shorter = ".".join((str(i) for i in version_tuple[:2]))
|
|
if is_pypy:
|
|
lookup += "pypy"
|
|
if lookup in op_imports.keys():
|
|
@@ -46,6 +47,10 @@ def get_opcode(version_tuple, is_pypy, a
|
|
# TODO: change bytecode version number comment line to indicate altered
|
|
return remap_opcodes(op_imports[lookup], alternate_opmap)
|
|
return op_imports[lookup]
|
|
+ else:
|
|
+ # Look for major.minor only
|
|
+ if shorter in op_imports.keys():
|
|
+ return op_imports[shorter]
|
|
if is_pypy:
|
|
pypy_str = " for pypy"
|
|
else:
|