Skip to content

Commit 92fae2c

Browse files
committed
Fix typing
1 parent af944e7 commit 92fae2c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

test/asynchronous/test_async_loop_unblocked.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,13 @@ async def background_task():
3333
last_run = None
3434
try:
3535
while True:
36-
if last_run:
36+
if last_run is not None:
3737
latencies.append(time.monotonic() - last_run)
3838
last_run = time.monotonic()
3939
await asyncio.sleep(0.1)
4040
except asyncio.CancelledError:
41-
latencies.append(time.monotonic() - last_run)
41+
if last_run is not None:
42+
latencies.append(time.monotonic() - last_run)
4243
raise
4344

4445
t = asyncio.create_task(background_task())

0 commit comments

Comments
 (0)