File tree Expand file tree Collapse file tree 2 files changed +12
-10
lines changed Expand file tree Collapse file tree 2 files changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -113,15 +113,17 @@ def statistics(self) -> EventStatistics:
113
113
"""
114
114
return EventStatistics (tasks_waiting = len (self ._tasks ))
115
115
116
- def __bool__ (self ) -> Literal [True ]:
117
- """Return True and raise warning."""
118
- warn_deprecated (
119
- self .__bool__ ,
120
- "0.30.1" ,
121
- issue = 3238 ,
122
- instead = self .is_set ,
123
- )
124
- return True
116
+ if not TYPE_CHECKING :
117
+
118
+ def __bool__ (self ) -> Literal [True ]:
119
+ """Return True and raise warning."""
120
+ warn_deprecated (
121
+ self .__bool__ ,
122
+ "0.31.0" ,
123
+ issue = 3238 ,
124
+ instead = self .is_set ,
125
+ )
126
+ return True
125
127
126
128
127
129
class _HasAcquireRelease (Protocol ):
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ async def test_Event() -> None:
25
25
26
26
with pytest .warns (
27
27
DeprecationWarning ,
28
- match = r"trio\.Event\.__bool__ is deprecated since Trio 0\.30\.1 ; use trio\.Event\.is_set instead \(https://github.com/python-trio/trio/issues/3238\)" ,
28
+ match = r"trio\.Event\.__bool__ is deprecated since Trio 0\.31\.0 ; use trio\.Event\.is_set instead \(https://github.com/python-trio/trio/issues/3238\)" ,
29
29
):
30
30
e .__bool__ ()
31
31
You can’t perform that action at this time.
0 commit comments