mirror of
https://github.com/django-q2/django-q2.git
synced 2026-10-07 15:38:11 +08:00
Merge pull request #292 from Eagllus/fix_python3_only_code
Fix python3 only code
This commit is contained in:
@@ -5,6 +5,7 @@ services:
|
|||||||
- mongodb
|
- mongodb
|
||||||
|
|
||||||
python:
|
python:
|
||||||
|
- "2.7"
|
||||||
- "3.6"
|
- "3.6"
|
||||||
|
|
||||||
env:
|
env:
|
||||||
@@ -12,6 +13,11 @@ env:
|
|||||||
- DJANGO=1.11.9
|
- DJANGO=1.11.9
|
||||||
- DJANGO=1.8.18
|
- DJANGO=1.8.18
|
||||||
|
|
||||||
|
matrix:
|
||||||
|
exclude:
|
||||||
|
- python: "2.7"
|
||||||
|
env: DJANGO=2.0
|
||||||
|
|
||||||
sudo: false
|
sudo: false
|
||||||
|
|
||||||
addons:
|
addons:
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ class TimestampSigner(Signer, TsS):
|
|||||||
Retrieve original value and check it wasn't signed more
|
Retrieve original value and check it wasn't signed more
|
||||||
than max_age seconds ago.
|
than max_age seconds ago.
|
||||||
"""
|
"""
|
||||||
result = super().unsign(value)
|
result = super(TimestampSigner, self).unsign(value)
|
||||||
value, timestamp = result.rsplit(self.sep, 1)
|
value, timestamp = result.rsplit(self.sep, 1)
|
||||||
timestamp = baseconv.base62.decode(timestamp)
|
timestamp = baseconv.base62.decode(timestamp)
|
||||||
if max_age is not None:
|
if max_age is not None:
|
||||||
|
|||||||
+6
-1
@@ -1,6 +1,7 @@
|
|||||||
"""
|
"""
|
||||||
The code is derived from https://github.com/althonos/pronto/commit/3384010dfb4fc7c66a219f59276adef3288a886b
|
The code is derived from https://github.com/althonos/pronto/commit/3384010dfb4fc7c66a219f59276adef3288a886b
|
||||||
"""
|
"""
|
||||||
|
import sys
|
||||||
|
|
||||||
import multiprocessing
|
import multiprocessing
|
||||||
import multiprocessing.queues
|
import multiprocessing.queues
|
||||||
@@ -48,7 +49,11 @@ class Queue(multiprocessing.queues.Queue):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
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)
|
self.size = SharedCounter(0)
|
||||||
|
|
||||||
def put(self, *args, **kwargs):
|
def put(self, *args, **kwargs):
|
||||||
|
|||||||
Reference in New Issue
Block a user