Files
python-xdis/ignore-patchlevel-in-python-version.patch

38 lines
1.5 KiB
Diff
Raw Permalink Normal View History

- Update to 6.0.3: * 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
2022-02-04 00:31:04 +00:00
Remove power from the folks who brought you linux2
Index: python-xdis-6.0.5/xdis/disasm.py
- Update to 6.0.3: * 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
2022-02-04 00:31:04 +00:00
===================================================================
--- 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
- Update to 6.0.3: * 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
2022-02-04 00:31:04 +00:00
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
- Update to 6.0.3: * 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
2022-02-04 00:31:04 +00:00
# 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".