From 540c3da8fdb038d0ee1e66270254f0802f9e72a4 Mon Sep 17 00:00:00 2001 From: Tomas Tomecek Date: Mon, 7 Jan 2019 17:04:57 +0100 Subject: [PATCH] accept methods as callbacks as well Signed-off-by: Tomas Tomecek --- fedora_messaging/_session.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fedora_messaging/_session.py b/fedora_messaging/_session.py index 7eb78eab..b20802f8 100644 --- a/fedora_messaging/_session.py +++ b/fedora_messaging/_session.py @@ -495,7 +495,7 @@ def consume(self, callback, bindings=None, queues=None, exchanges=None): " or a function." ) self._consumer_callback = cb_obj - elif inspect.isfunction(callback): + elif inspect.isfunction(callback) or inspect.ismethod(callback): self._consumer_callback = callback else: raise ValueError(