@@ -81,8 +81,7 @@ def __await__(self):
8181
8282 def __next__ (self ):
8383 if self .state is not None :
84- # CIRCUITPY-CHANGE: when 8.x support is discontinued, change to .push()
85- _task_queue .push_sorted (cur_task , self .state )
84+ _task_queue .push (cur_task , self .state )
8685 self .state = None
8786 return None
8887 else :
@@ -209,13 +208,11 @@ def wait_io_event(self, dt):
209208 # print('poll', s, sm, ev)
210209 if ev & ~ select .POLLOUT and sm [0 ] is not None :
211210 # POLLIN or error
212- # CIRCUITPY-CHANGE: when 8.x support is discontinued, change to .push()
213- _task_queue .push_head (sm [0 ])
211+ _task_queue .push (sm [0 ])
214212 sm [0 ] = None
215213 if ev & ~ select .POLLIN and sm [1 ] is not None :
216214 # POLLOUT or error
217- # CIRCUITPY-CHANGE: when 8.x support is discontinued, change to .push()
218- _task_queue .push_head (sm [1 ])
215+ _task_queue .push (sm [1 ])
219216 sm [1 ] = None
220217 if sm [0 ] is None and sm [1 ] is None :
221218 self ._dequeue (s )
@@ -245,8 +242,7 @@ def create_task(coro):
245242 if not hasattr (coro , "send" ):
246243 raise TypeError ("coroutine expected" )
247244 t = Task (coro , globals ())
248- # CIRCUITPY-CHANGE: when 8.x support is discontinued, change to .push()
249- _task_queue .push_head (t )
245+ _task_queue .push (t )
250246 return t
251247
252248
@@ -275,8 +271,7 @@ def run_until_complete(main_task=None):
275271 _io_queue .wait_io_event (dt )
276272
277273 # Get next task to run and continue it
278- # CIRCUITPY-CHANGE: when 8.x support is discontinued, change to .pop()
279- t = _task_queue .pop_head ()
274+ t = _task_queue .pop ()
280275 cur_task = t
281276 try :
282277 # Continue running the coroutine, it's responsible for rescheduling itself
@@ -313,17 +308,15 @@ def run_until_complete(main_task=None):
313308 else :
314309 # Schedule any other tasks waiting on the completion of this task.
315310 while t .state .peek ():
316- # CIRCUITPY-CHANGE: when 8.x support is discontinued, change to .push() and .pop()
317- _task_queue .push_head (t .state .pop_head ())
311+ _task_queue .push (t .state .pop ())
318312 waiting = True
319313 # "False" indicates that the task is complete and has been await'ed on.
320314 t .state = False
321315 if not waiting and not isinstance (er , excs_stop ):
322316 # An exception ended this detached task, so queue it for later
323317 # execution to handle the uncaught exception if no other task retrieves
324318 # the exception in the meantime (this is handled by Task.throw).
325- # CIRCUITPY-CHANGE: when 8.x support is discontinued, change to .push()
326- _task_queue .push_head (t )
319+ _task_queue .push (t )
327320 # Save return value of coro to pass up to caller.
328321 t .data = er
329322 elif t .state is None :
@@ -397,8 +390,7 @@ def stop():
397390
398391 global _stop_task
399392 if _stop_task is not None :
400- # CIRCUITPY-CHANGE: when 8.x support is discontinued, change to .push()
401- _task_queue .push_head (_stop_task )
393+ _task_queue .push (_stop_task )
402394 # If stop() is called again, do nothing
403395 _stop_task = None
404396
0 commit comments