Files
python-xdis/ignore-patchlevel-in-python-version.patch
Daniel Garcia 61c4350fdb - Skip python 3.11, not yet supported, gh#rocky/python-xdis#98
- Update to version 6.0.5
  * Detect versions pypy3.8.15, pypy-3.9.15
  * Dectect Python 3.{7,8,9}.14 3.10.{5,6,7}
  * correct 3.10+ pydisasm -F xasm label
  * Revise marshal error handling (Issue #97)
  * Improve PyPy 3.7 CALL_FUNCTION arg interpretation
  * Fix 1.5-2.x bugs in line number encoding
  * Fix showing MAKE_FUNCTION operand
  * Miscellaneous lint, black, and isort changes

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-xdis?expand=0&rev=35
2023-02-21 07:38:50 +00:00

38 lines
1.5 KiB
Diff

Remove power from the folks who brought you linux2
Index: python-xdis-6.0.5/xdis/disasm.py
===================================================================
--- python-xdis-6.0.5.orig/xdis/disasm.py
+++ python-xdis-6.0.5/xdis/disasm.py
@@ -42,6 +42,7 @@ from xdis.version_info import IS_PYPY, P
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():
@@ -49,6 +50,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:
Index: python-xdis-6.0.5/xdis/version_info.py
===================================================================
--- python-xdis-6.0.5.orig/xdis/version_info.py
+++ python-xdis-6.0.5/xdis/version_info.py
@@ -35,7 +35,7 @@ IS_PYPY = "__pypy__" in sys.builtin_modu
def version_tuple_to_str(
- version_tuple=PYTHON_VERSION_TRIPLE, start=0, end=3, delimiter="."
+ 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".