File: exceptiongroup.patch

package info (click to toggle)
python-anyio 4.12.1-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,428 kB
  • sloc: python: 17,589; sh: 21; makefile: 8
file content (24 lines) | stat: -rw-r--r-- 645 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Forwarded: https://github.com/agronholm/anyio/pull/1063

--- a/tests/test_taskgroups.py
+++ b/tests/test_taskgroups.py
@@ -11,7 +11,6 @@
 from unittest import mock
 
 import pytest
-from exceptiongroup import catch
 from pytest import FixtureRequest, MonkeyPatch
 
 import anyio
@@ -1555,8 +1554,10 @@
 
     with CancelScope() as scope:
         scope.cancel()
-        with catch({get_cancelled_exc_class(): handler}):
+        try:
             await anyio.sleep_forever()
+        except get_cancelled_exc_class() as e:
+            handler(BaseExceptionGroup("", [e]))
 
 
 async def test_cancel_child_task_when_host_is_shielded() -> None: