From 78ee891961b64d99b31e42c5c98c646e1e48cca6 Mon Sep 17 00:00:00 2001 From: Dominik 'Rathann' Mierzejewski Date: Tue, 2 Nov 2021 15:19:05 +0100 Subject: [PATCH] fix FTBFS with python 3.11 (#2019399) --- pyelftools-py311.patch | 24 ++++++++++++++++++++++++ pyelftools.spec | 8 +++++++- 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 pyelftools-py311.patch diff --git a/pyelftools-py311.patch b/pyelftools-py311.patch new file mode 100644 index 0000000..7f8a628 --- /dev/null +++ b/pyelftools-py311.patch @@ -0,0 +1,24 @@ +diff -up pyelftools-0.27/test/test_arm_call_reloc.py.py311 pyelftools-0.27/test/test_arm_call_reloc.py +--- pyelftools-0.27/test/test_arm_call_reloc.py.py311 2020-10-27 14:42:31.000000000 +0100 ++++ pyelftools-0.27/test/test_arm_call_reloc.py 2021-11-02 15:12:12.843113102 +0100 +@@ -38,7 +38,7 @@ class TestARMRElocation(unittest.TestCas + elf = ELFFile(f) + + # Comparison of '.text' section data +- self.assertEquals(do_relocation(rel_elf), ++ self.assertEqual(do_relocation(rel_elf), + elf.get_section_by_name('.text').data()) + + if __name__ == '__main__': +diff -up pyelftools-0.27/test/test_die_size.py.py311 pyelftools-0.27/test/test_die_size.py +--- pyelftools-0.27/test/test_die_size.py.py311 2020-10-27 14:42:31.000000000 +0100 ++++ pyelftools-0.27/test/test_die_size.py 2021-11-02 15:12:27.929234127 +0100 +@@ -26,7 +26,7 @@ class TestDieSize(unittest.TestCase): + dwarfinfo = elffile.get_dwarf_info() + for CU in dwarfinfo.iter_CUs(): + for child in CU.get_top_DIE().iter_children(): +- self.assertEquals(child.size, 3) ++ self.assertEqual(child.size, 3) + + if __name__ == '__main__': + unittest.main() diff --git a/pyelftools.spec b/pyelftools.spec index 535fc39..583e7d4 100644 --- a/pyelftools.spec +++ b/pyelftools.spec @@ -4,10 +4,12 @@ Summary: Pure-Python library for parsing and analyzing ELF files Name: pyelftools Version: 0.27 -Release: 4%{?dist} +Release: 5%{?dist} License: Public Domain URL: https://github.com/eliben/pyelftools Source0: https://github.com/eliben/pyelftools/archive/v%{version}/%{name}-%{version}.tar.gz +# https://github.com/eliben/pyelftools/issues/377 +Patch0: %{name}-py311.patch %global _description \ Pure-Python library for parsing and analyzing ELF files\ and DWARF debugging information. @@ -26,6 +28,7 @@ BuildArch: noarch %prep %setup -q +%patch0 -p1 -b .py311 %ifnarch x86_64 rm test/external_tools/readelf %endif @@ -59,6 +62,9 @@ popd %{python3_sitelib}/pyelftools-*.egg-info %changelog +* Tue Nov 02 2021 Dominik Mierzejewski - 0.27-5 +- fix FTBFS with python 3.11 (fixes #2019399) + * Fri Jul 23 2021 Fedora Release Engineering - 0.27-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild