mirror of https://github.com/Desuuuu/klipper.git
reactor: Use "import Queue as queue" for improved Python3 compatibility
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
0e9aa76066
commit
4905667ee2
|
@ -3,7 +3,7 @@
|
||||||
# Copyright (C) 2016-2019 Kevin O'Connor <kevin@koconnor.net>
|
# Copyright (C) 2016-2019 Kevin O'Connor <kevin@koconnor.net>
|
||||||
#
|
#
|
||||||
# This file may be distributed under the terms of the GNU GPLv3 license.
|
# This file may be distributed under the terms of the GNU GPLv3 license.
|
||||||
import os, select, math, time, Queue
|
import os, select, math, time, Queue as queue
|
||||||
import greenlet
|
import greenlet
|
||||||
import chelper, util
|
import chelper, util
|
||||||
|
|
||||||
|
@ -102,7 +102,7 @@ class SelectReactor:
|
||||||
self._next_timer = self.NEVER
|
self._next_timer = self.NEVER
|
||||||
# Callbacks
|
# Callbacks
|
||||||
self._pipe_fds = None
|
self._pipe_fds = None
|
||||||
self._async_queue = Queue.Queue()
|
self._async_queue = queue.Queue()
|
||||||
# File descriptors
|
# File descriptors
|
||||||
self._fds = []
|
self._fds = []
|
||||||
# Greenlets
|
# Greenlets
|
||||||
|
@ -170,7 +170,7 @@ class SelectReactor:
|
||||||
while 1:
|
while 1:
|
||||||
try:
|
try:
|
||||||
func, args = self._async_queue.get_nowait()
|
func, args = self._async_queue.get_nowait()
|
||||||
except Queue.Empty:
|
except queue.Empty:
|
||||||
break
|
break
|
||||||
func(*args)
|
func(*args)
|
||||||
def _setup_async_callbacks(self):
|
def _setup_async_callbacks(self):
|
||||||
|
|
Loading…
Reference in New Issue