mirror of
https://github.com/django-q2/django-q2.git
synced 2026-09-17 06:27:53 +08:00
Fix Python3 only code.
Thanks to @P-EB for providing the solution
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
"""
|
||||
The code is derived from https://github.com/althonos/pronto/commit/3384010dfb4fc7c66a219f59276adef3288a886b
|
||||
"""
|
||||
import sys
|
||||
|
||||
import multiprocessing
|
||||
import multiprocessing.queues
|
||||
@@ -48,7 +49,11 @@ class Queue(multiprocessing.queues.Queue):
|
||||
"""
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(Queue, self).__init__(*args, ctx=multiprocessing.get_context(), **kwargs)
|
||||
if sys.version_info < (3, 0):
|
||||
super(Queue, self).__init__(*args, **kwargs)
|
||||
else:
|
||||
super(Queue, self).__init__(*args, ctx=multiprocessing.get_context(), **kwargs)
|
||||
|
||||
self.size = SharedCounter(0)
|
||||
|
||||
def put(self, *args, **kwargs):
|
||||
|
||||
Reference in New Issue
Block a user