catchlib 1.0.2__tar.gz → 1.0.3__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: catchlib
3
- Version: 1.0.2
3
+ Version: 1.0.3
4
4
  Summary: This project allows to catch exceptions easily.
5
5
  Author-email: Johannes <johannes.programming@gmail.com>
6
6
  License: The MIT License (MIT)
@@ -26,7 +26,7 @@ keywords = []
26
26
  name = "catchlib"
27
27
  readme = "README.rst"
28
28
  requires-python = ">=3.11"
29
- version = "1.0.2"
29
+ version = "1.0.3"
30
30
 
31
31
  [project.license]
32
32
  file = "LICENSE.txt"
@@ -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 = self.caught
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 = self.caught
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
@@ -3,6 +3,8 @@ from typing import *
3
3
 
4
4
  from catchlib.core import Catcher
5
5
 
6
+ __all__ = ["TestCatcher"]
7
+
6
8
 
7
9
  class TestCatcher(unittest.TestCase):
8
10
  def test_captures_matching_exception(self: Self) -> None:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: catchlib
3
- Version: 1.0.2
3
+ Version: 1.0.3
4
4
  Summary: This project allows to catch exceptions easily.
5
5
  Author-email: Johannes <johannes.programming@gmail.com>
6
6
  License: The MIT License (MIT)
File without changes
File without changes
File without changes
File without changes