This commit is contained in:
Ask Solem 2016-06-15 17:48:41 -07:00
parent 2a88809157
commit d823c628ff
6 changed files with 25 additions and 16 deletions

View File

@ -13,7 +13,7 @@ def fib(n):
elif n == 1:
return 1
else:
return fib(n-1) + fib(n-2)
return fib(n - 1) + fib(n - 2)
class Worker(ConsumerProducerMixin):

View File

@ -1,4 +1,5 @@
from __future__ import absolute_import, unicode_literals
def hello_task(who='world'):
print('Hello {0}'.format(who))

View File

@ -44,14 +44,16 @@ if STATICA_HACK: # pragma: no cover
from types import ModuleType # noqa
all_by_module = {
'kombu.connection': ['Connection', 'BrokerConnection'],
'kombu.entity': ['Exchange', 'Queue', 'binding'],
'kombu.messaging': ['Consumer', 'Producer'],
'kombu.pools': ['connections', 'producers'],
'kombu.utils.url': ['parse_url'],
'kombu.common': ['eventloop', 'uuid'],
'kombu.serialization': ['enable_insecure_serializers',
'disable_insecure_serializers'],
'kombu.connection': ['Connection', 'BrokerConnection'],
'kombu.entity': ['Exchange', 'Queue', 'binding'],
'kombu.messaging': ['Consumer', 'Producer'],
'kombu.pools': ['connections', 'producers'],
'kombu.utils.url': ['parse_url'],
'kombu.common': ['eventloop', 'uuid'],
'kombu.serialization': [
'enable_insecure_serializers',
'disable_insecure_serializers',
],
}
object_origins = {}

View File

@ -167,7 +167,7 @@ class Producer(object):
)
if expiration is not None:
properties['expiration'] = str(int(expiration*1000))
properties['expiration'] = str(int(expiration * 1000))
body, content_type, content_encoding = self._prepare(
body, serializer, content_type, content_encoding,

View File

@ -1453,7 +1453,7 @@ class test_Transport__init(QPidCase):
def test_sets_non_blocking_behavior_on_r_fd(self):
Transport(Mock())
self.fcntl.fcntl.assert_called_once_with(
self.r, self.fcntl.F_SETFL, self.os.O_NONBLOCK)
self.r, self.fcntl.F_SETFL, self.os.O_NONBLOCK)
class test_Transport__drain_events(QPidCase):

View File

@ -649,12 +649,18 @@ class Channel(virtual.Channel):
def _handle_message(self, client, r):
if bytes_to_str(r[0]) == 'unsubscribe' and r[2] == 0:
client.subscribed = False
elif bytes_to_str(r[0]) == 'pmessage':
return {'type': r[0], 'pattern': r[1],
'channel': r[2], 'data': r[3]}
return
if bytes_to_str(r[0]) == 'pmessage':
type, pattern, channel, data = r[0], r[1], r[2], r[3]
else:
return {'type': r[0], 'pattern': None,
'channel': r[1], 'data': r[2]}
type, pattern, channel, data = r[0], None, r[1], r[2]
return {
'type': type,
'pattern': pattern,
'channel': channel,
'data': data,
}
def _receive(self):
c = self.subclient