|
8 | 8 |
|
9 | 9 | import multiprocessing
|
10 | 10 |
|
11 |
| -# SimpleQueue is available from multiprocessing.queues on |
12 |
| -# all Python versions known at the moment of writting the code |
13 |
| -# (up to 3.9). |
14 |
| -# |
15 |
| -# It was additionally exposed directly from the multiprocessing |
16 |
| -# module since Python 3.3 ([1]). |
| 11 | +# Queue is available from multiprocessing.queues on all Python |
| 12 | +# versions known at the moment of writting the code (up to 3.12). |
17 | 13 | #
|
18 | 14 | # However the mandatory argument 'ctx'
|
19 | 15 | # (see multiprocessing.get_context()) was added to the constructor
|
20 |
| -# of SimpleQueue from multiprocessing.queues since Python 3.4 |
21 |
| -# ([2]). |
| 16 | +# of Queue from multiprocessing.queues since Python 3.4 ([1]). |
22 | 17 | #
|
23 |
| -# So we should import SimpleQueue from multiprocessing on |
24 |
| -# Python 3.3+ (and must to do so on Python 3.4+) to uniformly |
25 |
| -# instantiate it (without constructor arguments). |
| 18 | +# So we should import Queue from multiprocessing on Python 3.4+ |
| 19 | +# to uniformly instantiate it (without constructor arguments). |
26 | 20 | #
|
27 |
| -# [1]: https://bugs.python.org/issue11836 |
28 |
| -# [2]: https://bugs.python.org/issue18999 |
| 21 | +# [1]: https://bugs.python.org/issue18999 |
29 | 22 | try:
|
30 |
| - # Python 3.3+ |
31 |
| - from multiprocessing import SimpleQueue |
| 23 | + # Python 3.4+ |
| 24 | + from multiprocessing import Queue |
32 | 25 | except ImportError:
|
33 | 26 | # Python 2
|
34 |
| - from multiprocessing.queues import SimpleQueue |
| 27 | + from multiprocessing.queues import Queue |
35 | 28 |
|
36 | 29 | from lib import Options
|
37 | 30 | from lib.sampler import sampler
|
@@ -363,8 +356,8 @@ def __init__(self, key, task_group, randomize):
|
363 | 356 | random.shuffle(self.task_ids)
|
364 | 357 | else:
|
365 | 358 | self.randomize = False
|
366 |
| - self.result_queue = SimpleQueue() |
367 |
| - self.task_queue = SimpleQueue() |
| 359 | + self.result_queue = Queue() |
| 360 | + self.task_queue = Queue() |
368 | 361 |
|
369 | 362 | # Don't expose queues file descriptors over Popen to, say, tarantool
|
370 | 363 | # running tests.
|
|
0 commit comments