Accepting request 1096944 from devel:languages:python

- Update to 1.1.2:
  - 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 
  (gh#agronholm/exceptiongroup#64).

OBS-URL: https://build.opensuse.org/request/show/1096944
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-exceptiongroup?expand=0&rev=6
This commit is contained in:
Fabian Vogt 2023-07-06 16:27:49 +00:00 committed by Git OBS Bridge
commit 26b832b505
5 changed files with 49 additions and 5 deletions

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:abe42a62bac0948d95bba6a48f63d8ebb21a7420fd26039a4ec951873fafaee7
size 23107

BIN
exceptiongroup-1.1.2-gh.tar.gz (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -1,3 +1,13 @@
-------------------------------------------------------------------
Tue Jul 4 22:32:27 UTC 2023 - Matej Cepl <mcepl@suse.com>
- Update to 1.1.2:
- 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
(gh#agronholm/exceptiongroup#64).
-------------------------------------------------------------------
Fri Apr 21 12:24:46 UTC 2023 - Dirk Müller <dmueller@suse.com>

View File

@ -29,12 +29,15 @@
%{?sle15_python_module_pythons}
Name: python-exceptiongroup%{psuffix}
Version: 1.1.1
Version: 1.1.2
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}
@ -75,7 +78,7 @@ exception group classes are used instead, ``TracebackException`` is not monkey p
and the exception hook won't be installed.
%prep
%setup -q -n exceptiongroup-%{version}
%autosetup -p1 -n exceptiongroup-%{version}
%if !%{with test}
%build

View File

@ -0,0 +1,31 @@
From 452ba0946347b4e0df950763213f162704bc1eed Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Alex=20Gr=C3=B6nholm?= <alex.gronholm@nextday.fi>
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: