Skip to content

Commit 40d25bc

Browse files
feature: Forward compatible use of queue module
1 parent 65c5a42 commit 40d25bc

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

__main__.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
import six
33
if six.PY2:
44
str = unicode
5+
import Queue as queue
6+
else:
7+
import queue
58

69
# stdlib imports
710

@@ -1496,7 +1499,7 @@ def __init__(self, container, exp_config, to_singleshot, from_singleshot, to_mul
14961499
# A queue for storing incoming files from the ZMQ server so
14971500
# the server can keep receiving files even if analysis is slow
14981501
# or paused:
1499-
self.incoming_queue = Queue.Queue()
1502+
self.incoming_queue = queue.Queue()
15001503

15011504
# Start the thread to handle incoming files, and store them in
15021505
# a buffer if processing is paused:
@@ -1601,7 +1604,7 @@ def incoming_buffer_loop(self):
16011604
while True:
16021605
try:
16031606
filepath = self.incoming_queue.get(False)
1604-
except Queue.Empty:
1607+
except queue.Empty:
16051608
break
16061609
else:
16071610
filepaths.append(filepath)
@@ -1755,12 +1758,12 @@ def __init__(self):
17551758

17561759
# The singleshot routinebox will be connected to the filebox
17571760
# by queues:
1758-
to_singleshot = Queue.Queue()
1759-
from_singleshot = Queue.Queue()
1761+
to_singleshot = queue.Queue()
1762+
from_singleshot = queue.Queue()
17601763

17611764
# So will the multishot routinebox:
1762-
to_multishot = Queue.Queue()
1763-
from_multishot = Queue.Queue()
1765+
to_multishot = queue.Queue()
1766+
from_multishot = queue.Queue()
17641767

17651768
self.output_box = OutputBox(self.ui.verticalLayout_output_box)
17661769
self.singleshot_routinebox = RoutineBox(self.ui.verticalLayout_singleshot_routinebox, self.exp_config,

0 commit comments

Comments
 (0)