From d96241454e4b5afd0f217fa48a95bd9dea016545 Mon Sep 17 00:00:00 2001 From: Ask Solem Date: Wed, 2 Oct 2013 14:48:30 +0100 Subject: [PATCH] Fixes typo --- kombu/common.py | 3 +-- kombu/tests/test_common.py | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/kombu/common.py b/kombu/common.py index df882708..a147cf0d 100644 --- a/kombu/common.py +++ b/kombu/common.py @@ -99,10 +99,9 @@ def _maybe_declare(entity): ident = hash(entity) if ident not in declared: entity.declare() - declared.add(entity) + declared.add(hash(entity)) return True return False - entity.declare() return True diff --git a/kombu/tests/test_common.py b/kombu/tests/test_common.py index 7cd1d8b0..1f918297 100644 --- a/kombu/tests/test_common.py +++ b/kombu/tests/test_common.py @@ -80,7 +80,7 @@ class test_maybe_declare(Case): maybe_declare(entity, channel) self.assertEqual(entity.declare.call_count, 1) - self.assertIn(entity, channel.connection.client.declared_entities) + self.assertIn(hash(entity), channel.connection.client.declared_entities) maybe_declare(entity, channel) self.assertEqual(entity.declare.call_count, 1)