From b1ad2b159aecae1a605224357b9d563528d4ef47 Mon Sep 17 00:00:00 2001 From: Ask Solem Date: Tue, 14 Jun 2016 14:27:26 -0700 Subject: [PATCH] Use LookupError --- kombu/transport/couchdb.py | 2 +- kombu/transport/virtual/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/kombu/transport/couchdb.py b/kombu/transport/couchdb.py index ac45cb19..66223e7a 100644 --- a/kombu/transport/couchdb.py +++ b/kombu/transport/couchdb.py @@ -67,7 +67,7 @@ class Channel(virtual.Channel): try: item = result[0]['value'] - except (KeyError, IndexError): + except LookupError: raise Empty() self.client.delete(item['_id']) return loads(bytes_to_str(item['payload'])) diff --git a/kombu/transport/virtual/__init__.py b/kombu/transport/virtual/__init__.py index c689ba68..5ecc0d72 100644 --- a/kombu/transport/virtual/__init__.py +++ b/kombu/transport/virtual/__init__.py @@ -923,7 +923,7 @@ class Transport(base.Transport): while l: try: channel = l.pop() - except (IndexError, KeyError): # pragma: no cover + except LookupError: # pragma: no cover pass else: channel.close()