From cc196127b8cedb5cd723a65f0398917239ce0694c5830654c66f4ebd42f1252d Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Mon, 27 Nov 2023 15:45:13 +0000 Subject: [PATCH] - update to 1.2.0: * Added special monkeypatching if `Apport `_ has overridden ``sys.excepthook`` so it will format exception groups correctly * Added a backport of ``contextlib.suppress()`` from Python 3.12.1 which also handles suppressing exceptions inside exception groups * Fixed bare ``raise`` in a handler reraising the original naked exception rather than an exception group which is what is raised when you do a ``raise`` in an ``except*`` handler * ``catch()`` now raises a ``TypeError`` if passed an async exception handler instead of just giving a ``RuntimeWarning`` about the coroutine never being awaited. * Fixed plain ``raise`` statement in an exception handler callback to work like a ``raise`` in an ``except*`` block * Fixed new exception group not being chained to the original exception when raising an exception group from exceptions raised in handler callbacks * Fixed type annotations of the ``derive()``, ``subgroup()`` and ``split()`` methods to match the ones in typeshed - drop skip-test_catch_handler_raises-for-older-311.patch (upstream) - Add skip-test_catch_handler_raises-for-older-311.patch OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-exceptiongroup?expand=0&rev=19 --- exceptiongroup-1.1.2-gh.tar.gz | 3 -- exceptiongroup-1.2.0-gh.tar.gz | 3 ++ python-exceptiongroup.changes | 29 ++++++++++++++++- python-exceptiongroup.spec | 5 +-- ...t_catch_handler_raises-for-older-311.patch | 31 ------------------- 5 files changed, 32 insertions(+), 39 deletions(-) delete mode 100644 exceptiongroup-1.1.2-gh.tar.gz create mode 100644 exceptiongroup-1.2.0-gh.tar.gz delete mode 100644 skip-test_catch_handler_raises-for-older-311.patch diff --git a/exceptiongroup-1.1.2-gh.tar.gz b/exceptiongroup-1.1.2-gh.tar.gz deleted file mode 100644 index ace6af4..0000000 --- a/exceptiongroup-1.1.2-gh.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:107e769418fac86697c510aa0e6849ae48d384b20186ec4db5c23e567829589f -size 23079 diff --git a/exceptiongroup-1.2.0-gh.tar.gz b/exceptiongroup-1.2.0-gh.tar.gz new file mode 100644 index 0000000..b643c67 --- /dev/null +++ b/exceptiongroup-1.2.0-gh.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8eaefb1a57cc9efcc601f346507c6daec23c5aced4691d64b0679d8728e50572 +size 27368 diff --git a/python-exceptiongroup.changes b/python-exceptiongroup.changes index 0484fec..6264470 100644 --- a/python-exceptiongroup.changes +++ b/python-exceptiongroup.changes @@ -1,3 +1,30 @@ +------------------------------------------------------------------- +Mon Nov 27 15:43:56 UTC 2023 - Dirk Müller + +- update to 1.2.0: + * Added special monkeypatching if `Apport + `_ has + overridden ``sys.excepthook`` so it will format exception + groups correctly + * Added a backport of ``contextlib.suppress()`` from Python + 3.12.1 which also handles suppressing exceptions inside + exception groups + * Fixed bare ``raise`` in a handler reraising the original + naked exception rather than an exception group which is what + is raised when you do a ``raise`` in an ``except*`` handler + * ``catch()`` now raises a ``TypeError`` if passed an async + exception handler instead of just giving a ``RuntimeWarning`` + about the coroutine never being awaited. + * Fixed plain ``raise`` statement in an exception handler + callback to work like a ``raise`` in an ``except*`` block + * Fixed new exception group not being chained to the original + exception when raising an exception group from exceptions + raised in handler callbacks + * Fixed type annotations of the ``derive()``, ``subgroup()`` + and ``split()`` methods to match the ones in typeshed +- drop skip-test_catch_handler_raises-for-older-311.patch + (upstream) + ------------------------------------------------------------------- Tue Jul 4 22:32:27 UTC 2023 - Matej Cepl @@ -5,7 +32,7 @@ Tue Jul 4 22:32:27 UTC 2023 - Matej Cepl - Changed handling of exceptions in exception group handler callbacks to not wrap a single exception in an exception group, as per CPython issue gh#python/cpython#103590. -- Add skip-test_catch_handler_raises-for-older-311.patch +- Add skip-test_catch_handler_raises-for-older-311.patch (gh#agronholm/exceptiongroup#64). ------------------------------------------------------------------- diff --git a/python-exceptiongroup.spec b/python-exceptiongroup.spec index 836ea59..6f47d35 100644 --- a/python-exceptiongroup.spec +++ b/python-exceptiongroup.spec @@ -29,15 +29,12 @@ %{?sle15_python_module_pythons} Name: python-exceptiongroup%{psuffix} -Version: 1.1.2 +Version: 1.2.0 Release: 0 Summary: Backport of PEP 654 (exception groups) License: MIT AND Python-2.0 URL: https://github.com/agronholm/exceptiongroup Source: https://github.com/agronholm/exceptiongroup/archive/refs/tags/%{version}.tar.gz#/exceptiongroup-%{version}-gh.tar.gz -# PATCH-FIX-UPSTREAM skip-test_catch_handler_raises-for-older-311.patch gh#agronholm/exceptiongroup#64 mcepl@suse.com -# Skip test_catch_handler_raises() on Python 3.11 if the Python version is less than 3.11.4 -Patch0: skip-test_catch_handler_raises-for-older-311.patch BuildRequires: %{python_module base >= 3.7} BuildRequires: %{python_module flit-scm} BuildRequires: %{python_module pip} diff --git a/skip-test_catch_handler_raises-for-older-311.patch b/skip-test_catch_handler_raises-for-older-311.patch deleted file mode 100644 index 754d8ae..0000000 --- a/skip-test_catch_handler_raises-for-older-311.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 452ba0946347b4e0df950763213f162704bc1eed Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Alex=20Gr=C3=B6nholm?= -Date: Wed, 5 Jul 2023 12:28:15 +0300 -Subject: [PATCH] Skip test_catch_handler_raises() on Python 3.11 if the Python - version is too low - ---- - tests/test_catch_py311.py | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/tests/test_catch_py311.py b/tests/test_catch_py311.py -index 4351be8..5880f0a 100644 ---- a/tests/test_catch_py311.py -+++ b/tests/test_catch_py311.py -@@ -1,3 +1,5 @@ -+import sys -+ - import pytest - - from exceptiongroup import ExceptionGroup -@@ -121,6 +123,10 @@ def test_catch_full_match(): - pass - - -+@pytest.mark.skipif( -+ sys.version_info < (3, 11, 4), -+ reason="Behavior was changed in 3.11.4", -+) - def test_catch_handler_raises(): - with pytest.raises(RuntimeError, match="new"): - try: