@@ -81,8 +81,7 @@ def __await__(self):
81
81
82
82
def __next__ (self ):
83
83
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 )
86
85
self .state = None
87
86
return None
88
87
else :
@@ -209,13 +208,11 @@ def wait_io_event(self, dt):
209
208
# print('poll', s, sm, ev)
210
209
if ev & ~ select .POLLOUT and sm [0 ] is not None :
211
210
# 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 ])
214
212
sm [0 ] = None
215
213
if ev & ~ select .POLLIN and sm [1 ] is not None :
216
214
# 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 ])
219
216
sm [1 ] = None
220
217
if sm [0 ] is None and sm [1 ] is None :
221
218
self ._dequeue (s )
@@ -245,8 +242,7 @@ def create_task(coro):
245
242
if not hasattr (coro , "send" ):
246
243
raise TypeError ("coroutine expected" )
247
244
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 )
250
246
return t
251
247
252
248
@@ -275,8 +271,7 @@ def run_until_complete(main_task=None):
275
271
_io_queue .wait_io_event (dt )
276
272
277
273
# 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 ()
280
275
cur_task = t
281
276
try :
282
277
# Continue running the coroutine, it's responsible for rescheduling itself
@@ -313,17 +308,15 @@ def run_until_complete(main_task=None):
313
308
else :
314
309
# Schedule any other tasks waiting on the completion of this task.
315
310
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 ())
318
312
waiting = True
319
313
# "False" indicates that the task is complete and has been await'ed on.
320
314
t .state = False
321
315
if not waiting and not isinstance (er , excs_stop ):
322
316
# An exception ended this detached task, so queue it for later
323
317
# execution to handle the uncaught exception if no other task retrieves
324
318
# 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 )
327
320
# Save return value of coro to pass up to caller.
328
321
t .data = er
329
322
elif t .state is None :
@@ -397,8 +390,7 @@ def stop():
397
390
398
391
global _stop_task
399
392
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 )
402
394
# If stop() is called again, do nothing
403
395
_stop_task = None
404
396
0 commit comments