From 2e3ad0ba352e1626a5fafd4c64c99cd42d6186d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?N=C3=A9munaire?= Date: Fri, 31 Aug 2012 01:34:58 +0200 Subject: [PATCH] Check instance type of response in ordre to show only true Response --- consumer.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/consumer.py b/consumer.py index 9533ea0..70932b0 100644 --- a/consumer.py +++ b/consumer.py @@ -22,6 +22,7 @@ import traceback import sys from message import Message +from response import Response class Consumer(threading.Thread): def __init__(self, context): @@ -50,8 +51,9 @@ class Consumer(threading.Thread): if res is not None: if isinstance(res, list): for r in res: - srv.send_response(r) - else: + if isinstance(r, Response): + srv.send_response(r) + elif isinstance(res, Response): srv.send_response(res) except queue.Empty: