Skip to content

Commit 0b68f61

Browse files
committed
flake8'd
1 parent 310f13b commit 0b68f61

5 files changed

Lines changed: 9 additions & 9 deletions

File tree

tests/test_concurrent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ async def _test_same_task():
5252
def get_loop(i):
5353
loops[i] = (asyncio.get_event_loop(), asyncio.get_event_loop_policy())
5454

55-
async with trio.open_nursery() as n:
55+
async with trio.open_nursery():
5656
async with trio_asyncio.open_loop() as loop1:
5757
async with trio_asyncio.open_loop() as loop2:
5858
loop1.call_later(0.1, get_loop, 0)

trio_asyncio/async_.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import trio
2-
import asyncio
32

43
from async_generator import async_generator, yield_, asynccontextmanager
54

trio_asyncio/base.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import os
22
import sys
3-
import inspect
43
import math
54
import trio
65
import heapq

trio_asyncio/loop.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,6 @@
3636
class _TrioPolicy(asyncio.events.BaseDefaultEventLoopPolicy):
3737
_loop_factory = TrioEventLoop
3838

39-
def __init__(self):
40-
super().__init__()
41-
current_loop = trio.TaskLocal(_loop=None, _task=False)
42-
4339
def new_event_loop(self):
4440
try:
4541
trio.hazmat.current_task()
@@ -102,6 +98,8 @@ def set_event_loop(self, loop):
10298

10399
from asyncio import events as _aio_event
104100

101+
#####
102+
105103
_orig_policy_get = _aio_event.get_event_loop_policy
106104

107105

@@ -120,10 +118,12 @@ def _new_policy_get():
120118
_aio_event.get_event_loop_policy = _new_policy_get
121119
asyncio.get_event_loop_policy = _new_policy_get
122120

121+
#####
122+
123123
_orig_run_get = _aio_event._get_running_loop
124124

125125

126-
def _new_loop_get():
126+
def _new_run_get():
127127
try:
128128
return _current_loop.loop
129129
except RuntimeError:
@@ -132,6 +132,8 @@ def _new_loop_get():
132132

133133
_aio_event._get_running_loop = _new_run_get
134134

135+
#####
136+
135137
_orig_loop_get = _aio_event.get_event_loop
136138

137139

trio_asyncio/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ async def consume_next():
6363
item = STOP
6464

6565
trio.hazmat.reschedule(task, trio.hazmat.Value(value=item))
66-
#trio.hazmat.reschedule(task, STOP)
66+
# trio.hazmat.reschedule(task, STOP)
6767

6868
def abort_cb(raise_cancel_arg):
6969
# Save the cancel-raising function

0 commit comments

Comments
 (0)