diff --git a/dev-python/tblib/files/tblib-3.0.0-test.patch b/dev-python/tblib/files/tblib-3.0.0-test.patch new file mode 100644 index 0000000000000..fb1aed1344d5f --- /dev/null +++ b/dev-python/tblib/files/tblib-3.0.0-test.patch @@ -0,0 +1,35 @@ +diff --git a/tests/test_pickle_exception.py b/tests/test_pickle_exception.py +index 5ff4679..53a9dce 100644 +--- a/tests/test_pickle_exception.py ++++ b/tests/test_pickle_exception.py +@@ -29,6 +29,10 @@ class CustomError(Exception): + pass + + ++def strip_locations(tb_text): ++ return tb_text.replace(' ~~^~~\n', '').replace(' ^^^^^^^^^^^^^^^^^\n', '') ++ ++ + @pytest.mark.parametrize('protocol', [None, *list(range(1, pickle.HIGHEST_PROTOCOL + 1))]) + @pytest.mark.parametrize('how', ['global', 'instance', 'class']) + def test_install(clear_dispatch_table, how, protocol): +@@ -58,8 +62,8 @@ def test_install(clear_dispatch_table, how, protocol): + else: + raise AssertionError + +- expected_format_exception = ''.join(format_exception(type(exc), exc, exc.__traceback__)) +- print(expected_format_exception) ++ expected_format_exception = strip_locations(''.join(format_exception(type(exc), exc, exc.__traceback__))) ++ + # Populate Exception.__dict__, which is used in some cases + exc.x = 1 + exc.__cause__.x = 2 +@@ -88,7 +92,7 @@ def test_install(clear_dispatch_table, how, protocol): + if has_python311: + assert exc.__notes__ == ['note 1', 'note 2'] + +- assert expected_format_exception == ''.join(format_exception(type(exc), exc, exc.__traceback__)) ++ assert expected_format_exception == strip_locations(''.join(format_exception(type(exc), exc, exc.__traceback__))) + + + @tblib.pickling_support.install diff --git a/dev-python/tblib/tblib-3.0.0.ebuild b/dev-python/tblib/tblib-3.0.0.ebuild index a16181b168e7c..ce963787db28a 100644 --- a/dev-python/tblib/tblib-3.0.0.ebuild +++ b/dev-python/tblib/tblib-3.0.0.ebuild @@ -1,10 +1,10 @@ -# Copyright 1999-2024 Gentoo Authors +# Copyright 1999-2025 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 DISTUTILS_USE_PEP517=setuptools -PYTHON_COMPAT=( python3_{10..13} pypy3 ) +PYTHON_COMPAT=( python3_{10..13} pypy3 pypy3_11 ) inherit distutils-r1 pypi @@ -29,6 +29,11 @@ BDEPEND=" distutils_enable_tests pytest +PATCHES=( + # combined fixes from https://github.com/ionelmc/python-tblib/issues/74 + "${FILESDIR}/${P}-test.patch" +) + python_test() { local -x PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 local -x PYTHONNODEBUGRANGES=yes