catchlib 1.0.2__py3-none-any.whl → 1.0.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- catchlib/core/__init__.py +5 -3
- catchlib/tests/test_0.py +2 -0
- {catchlib-1.0.2.dist-info → catchlib-1.0.3.dist-info}/METADATA +1 -1
- catchlib-1.0.3.dist-info/RECORD +9 -0
- catchlib-1.0.2.dist-info/RECORD +0 -9
- {catchlib-1.0.2.dist-info → catchlib-1.0.3.dist-info}/WHEEL +0 -0
- {catchlib-1.0.2.dist-info → catchlib-1.0.3.dist-info}/licenses/LICENSE.txt +0 -0
- {catchlib-1.0.2.dist-info → catchlib-1.0.3.dist-info}/top_level.txt +0 -0
catchlib/core/__init__.py
CHANGED
|
@@ -20,8 +20,8 @@ class Catcher:
|
|
|
20
20
|
@contextmanager
|
|
21
21
|
def catch(self: Self, *args: type[BaseException]) -> Generator[Self, None, None]:
|
|
22
22
|
"This contextmanager catches exceptions."
|
|
23
|
-
self._caught = None
|
|
24
23
|
exc: BaseException
|
|
24
|
+
self._caught = None
|
|
25
25
|
try:
|
|
26
26
|
yield self
|
|
27
27
|
except args as exc:
|
|
@@ -40,7 +40,8 @@ class Catcher:
|
|
|
40
40
|
@release.overload(False)
|
|
41
41
|
def release(self: Self) -> None:
|
|
42
42
|
"This method raises the caught exception."
|
|
43
|
-
exc: BaseException
|
|
43
|
+
exc: BaseException
|
|
44
|
+
exc = self.caught
|
|
44
45
|
self._caught = None
|
|
45
46
|
if exc is not None:
|
|
46
47
|
raise exc
|
|
@@ -48,7 +49,8 @@ class Catcher:
|
|
|
48
49
|
@release.overload(True)
|
|
49
50
|
def release(self: Self, cause: Optional[BaseException]) -> None:
|
|
50
51
|
"This method raises the caught exception."
|
|
51
|
-
exc: BaseException
|
|
52
|
+
exc: BaseException
|
|
53
|
+
exc = self.caught
|
|
52
54
|
self._caught = None
|
|
53
55
|
if exc is not None:
|
|
54
56
|
raise exc from cause
|
catchlib/tests/test_0.py
CHANGED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
catchlib/__init__.py,sha256=LmWT7JBQPWFiRLTuaTqgduz9WH_4q2EyEtZMaBLIWe8,57
|
|
2
|
+
catchlib/core/__init__.py,sha256=sIWKb7bjKvyeOAuTfwrM__j17nllYaCLZVQg6ymPwso,1548
|
|
3
|
+
catchlib/tests/__init__.py,sha256=rNCdqp3ppovaIKlKOHLcBqF2-JgrV9wdn8tQF0-nl7c,430
|
|
4
|
+
catchlib/tests/test_0.py,sha256=oJtMbo6oSb3aX0Y5-2ICre3_sEQ-bSlbN2Zb5CAVJc8,2711
|
|
5
|
+
catchlib-1.0.3.dist-info/licenses/LICENSE.txt,sha256=fOh9FHccUt9OcJPBaVJ482GX4yrl_FxCUk9YRZ53JOI,1074
|
|
6
|
+
catchlib-1.0.3.dist-info/METADATA,sha256=HocnXegWOoWCaIJa-_0NM_4Dthi0baeLz48kjtzrpnc,2349
|
|
7
|
+
catchlib-1.0.3.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
8
|
+
catchlib-1.0.3.dist-info/top_level.txt,sha256=pZsP_Y2Suk_fAyIQrw4g81DUtgZBRIWzb-5Bk-0jmZs,9
|
|
9
|
+
catchlib-1.0.3.dist-info/RECORD,,
|
catchlib-1.0.2.dist-info/RECORD
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
catchlib/__init__.py,sha256=LmWT7JBQPWFiRLTuaTqgduz9WH_4q2EyEtZMaBLIWe8,57
|
|
2
|
-
catchlib/core/__init__.py,sha256=duXNKcfqWK1rh7mWO9zSdtiJYDFxwpcTrjHQZUk7yPk,1524
|
|
3
|
-
catchlib/tests/__init__.py,sha256=rNCdqp3ppovaIKlKOHLcBqF2-JgrV9wdn8tQF0-nl7c,430
|
|
4
|
-
catchlib/tests/test_0.py,sha256=AyTakeyPgVf73ijJifEtN3jls8cJEhEEhEug9lpOTfk,2684
|
|
5
|
-
catchlib-1.0.2.dist-info/licenses/LICENSE.txt,sha256=fOh9FHccUt9OcJPBaVJ482GX4yrl_FxCUk9YRZ53JOI,1074
|
|
6
|
-
catchlib-1.0.2.dist-info/METADATA,sha256=hii-Jp9MAoLr_MnrPLjT1UIaj8Zcl_xyCW0j0uf0t5o,2349
|
|
7
|
-
catchlib-1.0.2.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
8
|
-
catchlib-1.0.2.dist-info/top_level.txt,sha256=pZsP_Y2Suk_fAyIQrw4g81DUtgZBRIWzb-5Bk-0jmZs,9
|
|
9
|
-
catchlib-1.0.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|