Ravenports generated: 30 Jan 2023 20:50
[ravenports.git] / bucket_C4 / python-exceptiongroup
1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
2
3 NAMEBASE=               python-exceptiongroup
4 VERSION=                1.1.0
5 KEYWORDS=               python
6 VARIANTS=               py310 v11
7 SDESC[py310]=           Backport of PEP 654 (exception groups) (3.10)
8 SDESC[v11]=             Backport of PEP 654 (exception groups) (3.11)
9 HOMEPAGE=               none
10 CONTACT=                Python_Automaton[python@ironwolf.systems]
11
12 DOWNLOAD_GROUPS=        main
13 SITES[main]=            PYPIWHL/e8/14/9c6a7e5f12294ccd6975a45e02899ed25468cd7c2c86f3d9725f387f9f5f
14 DISTFILE[1]=            exceptiongroup-1.1.0-py3-none-any.whl:main
15 DF_INDEX=               1
16 SPKGS[py310]=           single
17 SPKGS[v11]=             single
18
19 OPTIONS_AVAILABLE=      PY310 PY311
20 OPTIONS_STANDARD=       none
21 VOPTS[py310]=           PY310=ON PY311=OFF
22 VOPTS[v11]=             PY310=OFF PY311=ON
23
24 DISTNAME=               exceptiongroup-1.1.0.dist-info
25
26 GENERATED=              yes
27
28 [PY310].USES_ON=                        python:py310,wheel
29
30 [PY311].USES_ON=                        python:v11,wheel
31
32 [FILE:3080:descriptions/desc.single]
33   :alt: Build Status
34   :alt: Code Coverage
35
36 This is a backport of the BaseExceptionGroup and ExceptionGroup classes
37 from
38 Python 3.11.
39
40 It contains the following:
41
42 * The  ``exceptiongroup.BaseExceptionGroup and
43 exceptiongroup.ExceptionGroup``
44   classes
45 * A utility function (``exceptiongroup.catch()``) for catching exceptions
46 possibly
47   nested in an exception group
48 * Patches to the TracebackException class that properly formats exception
49 groups
50   (installed on import)
51 * An exception hook that handles formatting of exception groups through
52   TracebackException (installed on import)
53 * Special versions of some of the functions from the traceback module,
54 modified to
55   correctly handle exception groups even when monkey patching is disabled,
56 or blocked by
57   another custom exception hook:
58
59   * ``traceback.format_exception()``
60   * ``traceback.format_exception_only()``
61   * ``traceback.print_exception()``
62   * ``traceback.print_exc()``
63
64 If this package is imported on Python 3.11 or later, the built-in
65 implementations of the
66 exception group classes are used instead, TracebackException is not monkey
67 patched
68 and the exception hook won't be installed.
69
70 See the `standard library documentation`_ for more information on exception
71 groups.
72
73 .. _standard library documentation:
74 https://docs.python.org/3/library/exceptions.html
75
76 Catching exceptions
77 ===================
78
79 Due to the lack of the ``except*`` syntax introduced by `PEP 654`_ in
80 earlier Python
81 versions, you need to use ``exceptiongroup.catch()`` to catch exceptions
82 that are
83 potentially nested inside an exception group. This function returns a
84 context manager
85 that calls the given handler for any exceptions matching the sole argument.
86
87 The argument to ``catch()`` must be a dict (or any Mapping) where each key
88 is either
89 an exception class or an iterable of exception classes. Each value must be
90 a callable
91 that takes a single positional argument. The handler will be called at most
92 once, with
93 an exception group as an argument which will contain all the exceptions
94 that are any
95 of the given types, or their subclasses. The exception group may contain
96 nested groups
97 containing more matching exceptions.
98
99 Thus, the following Python 3.11+ code:
100
101 .. code-block:: python3
102
103     try:
104         ...
105     except* (ValueError, KeyError) as excgroup:
106         for exc in excgroup.exceptions:
107             print('Caught exception:', type(exc))
108     except* RuntimeError:
109         print('Caught runtime error')
110
111 would be written with this backport like this:
112
113 .. code-block:: python3
114
115     from exceptiongroup import ExceptionGroup, catch
116
117     def value_key_err_handler(excgroup: ExceptionGroup) -> None:
118         for exc in excgroup.exceptions:
119             print('Caught exception:', type(exc))
120
121     def runtime_err_handler(exc: ExceptionGroup) -> None:
122         print('Caught runtime error')
123
124     with catch({
125         (ValueError, KeyError): value_key_err_handler,
126         RuntimeError: runtime_err_handler
127     }):
128         ...
129
130 **NOTE**: Just like with ``except*``, you cannot handle BaseExceptionGroup
131 or
132 ExceptionGroup with ``catch()``.
133
134
135 [FILE:116:distinfo]
136 327cbda3da756e2de031a3107b81ab7b3770a602c4d16ca618298c526f4bec1e        14263 exceptiongroup-1.1.0-py3-none-any.whl
137