From fb24ea5f53f685b8df8e14f77c4388ada06041f0 Mon Sep 17 00:00:00 2001 From: Sergey Tikhonov Date: Thu, 12 Feb 2015 17:33:55 +0300 Subject: [PATCH] #453 remove recursion and add separate bindings handling for as_dict(recurse=True) --- kombu/entity.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/kombu/entity.py b/kombu/entity.py index e0ea035e..87486070 100644 --- a/kombu/entity.py +++ b/kombu/entity.py @@ -730,3 +730,13 @@ class Queue(MaybeChannelBound): queue_arguments=q_arguments, binding_arguments=b_arguments, bindings=bindings) + + def as_dict(self, recurse=False): + res = super(Queue, self).as_dict(recurse) + if not recurse: + return res + bindings = res.get('bindings') + if bindings: + res['bindings'] = [b.as_dict(recurse=True) for b in bindings] + return res +