@@ -23,11 +23,11 @@ async def run_aio_future(future):
2323 This is a Trio-flavored async function.
2424
2525 """
26- task = trio .hazmat .current_task ()
26+ task = trio .lowlevel .current_task ()
2727 raise_cancel = None
2828
2929 def done_cb (_ ):
30- trio .hazmat .reschedule (task , outcome .capture (future .result ))
30+ trio .lowlevel .reschedule (task , outcome .capture (future .result ))
3131
3232 future .add_done_callback (done_cb )
3333
@@ -38,10 +38,10 @@ def abort_cb(raise_cancel_arg):
3838 # Attempt to cancel our future
3939 future .cancel ()
4040 # Keep waiting
41- return trio .hazmat .Abort .FAILED
41+ return trio .lowlevel .Abort .FAILED
4242
4343 try :
44- res = await trio .hazmat .wait_task_rescheduled (abort_cb )
44+ res = await trio .lowlevel .wait_task_rescheduled (abort_cb )
4545 return res
4646 except asyncio .CancelledError as exc :
4747 if raise_cancel is not None :
@@ -64,7 +64,7 @@ async def run_aio_generator(loop, async_generator):
6464 doesn't have to be). The asyncio tasks that perform each iteration
6565 of *async_generator* will run in *loop*.
6666 """
67- task = trio .hazmat .current_task ()
67+ task = trio .lowlevel .current_task ()
6868 raise_cancel = None
6969 current_read = None
7070
@@ -83,7 +83,7 @@ async def consume_next():
8383 finally :
8484 sniffio .current_async_library_cvar .reset (t )
8585
86- trio .hazmat .reschedule (task , result )
86+ trio .lowlevel .reschedule (task , result )
8787
8888 def abort_cb (raise_cancel_arg ):
8989 # Save the cancel-raising function
@@ -92,25 +92,25 @@ def abort_cb(raise_cancel_arg):
9292
9393 if not current_read :
9494 # There is no current read
95- return trio .hazmat .Abort .SUCCEEDED
95+ return trio .lowlevel .Abort .SUCCEEDED
9696 else :
9797 # Attempt to cancel the current iterator read, do not
9898 # report success until the future was actually cancelled.
9999 already_cancelled = current_read .cancel ()
100100 if already_cancelled :
101- return trio .hazmat .Abort .SUCCEEDED
101+ return trio .lowlevel .Abort .SUCCEEDED
102102 else :
103103 # Continue dealing with the cancellation once
104104 # future.cancel() goes to the result of
105105 # wait_task_rescheduled()
106- return trio .hazmat .Abort .FAILED
106+ return trio .lowlevel .Abort .FAILED
107107
108108 try :
109109 while True :
110110 # Schedule in asyncio that we read the next item from the iterator
111111 current_read = asyncio .ensure_future (consume_next (), loop = loop )
112112
113- item = await trio .hazmat .wait_task_rescheduled (abort_cb )
113+ item = await trio .lowlevel .wait_task_rescheduled (abort_cb )
114114
115115 if item is STOP :
116116 break
0 commit comments