@@ -67,7 +67,7 @@ async def aprotected() -> None:
67
67
await aunprotected ()
68
68
69
69
@_core .disable_ki_protection
70
- async def aunprotected () -> None : # noqa: RUF029 # async fn missing await
70
+ async def aunprotected () -> None :
71
71
assert not _core .currently_ki_protected ()
72
72
73
73
await aprotected ()
@@ -128,8 +128,7 @@ async def child(expected: bool) -> None:
128
128
129
129
# This also used to be broken due to
130
130
# https://bugs.python.org/issue29590
131
- # async function missing await
132
- async def test_generator_based_context_manager_throw () -> None : # noqa: RUF029
131
+ async def test_generator_based_context_manager_throw () -> None :
133
132
@contextlib .contextmanager
134
133
@_core .enable_ki_protection
135
134
def protected_manager () -> Iterator [None ]:
@@ -196,18 +195,16 @@ async def agen_unprotected2() -> None:
196
195
197
196
async def test_native_agen_protection () -> None :
198
197
# Native async generators
199
- # async function missing await
200
198
@_core .enable_ki_protection
201
- async def agen_protected () -> AsyncIterator [None ]: # noqa: RUF029
199
+ async def agen_protected () -> AsyncIterator [None ]:
202
200
assert _core .currently_ki_protected ()
203
201
try :
204
202
yield
205
203
finally :
206
204
assert _core .currently_ki_protected ()
207
205
208
- # async function missing await
209
206
@_core .disable_ki_protection
210
- async def agen_unprotected () -> AsyncIterator [None ]: # noqa: RUF029
207
+ async def agen_unprotected () -> AsyncIterator [None ]:
211
208
assert not _core .currently_ki_protected ()
212
209
try :
213
210
yield
@@ -324,9 +321,7 @@ async def check_protected_kill() -> None:
324
321
# error, then kill)
325
322
print ("check 3" )
326
323
327
- async def check_kill_during_shutdown () -> ( # noqa: RUF029 # async fn missing await
328
- None
329
- ):
324
+ async def check_kill_during_shutdown () -> None :
330
325
token = _core .current_trio_token ()
331
326
332
327
def kill_during_shutdown () -> None :
@@ -431,7 +426,7 @@ def abort(raise_cancel: RaiseCancelT) -> Abort:
431
426
print ("check 9" )
432
427
433
428
@_core .enable_ki_protection
434
- async def main_6 () -> None : # noqa: RUF029 # async function missing await
429
+ async def main_6 () -> None :
435
430
ki_self ()
436
431
437
432
with pytest .raises (KeyboardInterrupt ):
@@ -490,7 +485,7 @@ def test_ki_is_good_neighbor() -> None:
490
485
def my_handler (signum : object , frame : object ) -> None : # pragma: no cover
491
486
pass
492
487
493
- async def main () -> None : # noqa: RUF029 # async function missing await
488
+ async def main () -> None :
494
489
signal .signal (signal .SIGINT , my_handler )
495
490
496
491
_core .run (main )
@@ -514,7 +509,7 @@ def test_ki_with_broken_threads() -> None:
514
509
del threading ._active [thread .ident ] # type: ignore[attr-defined]
515
510
516
511
@_core .enable_ki_protection
517
- async def inner () -> None : # noqa: RUF029 # async function missing await
512
+ async def inner () -> None :
518
513
assert signal .getsignal (signal .SIGINT ) != signal .default_int_handler
519
514
520
515
_core .run (inner )
0 commit comments