From 11300af9f3afe9f06890949b42e644638d10fd73 Mon Sep 17 00:00:00 2001 From: Vladimir Khramov Date: Thu, 24 Jan 2019 15:06:03 +0300 Subject: [PATCH] coro checking --- kafka_transport/__main__.py | 3 +-- setup.py | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/kafka_transport/__main__.py b/kafka_transport/__main__.py index f8f4991..b4a0bd6 100644 --- a/kafka_transport/__main__.py +++ b/kafka_transport/__main__.py @@ -6,7 +6,6 @@ import msgpack import uuid import time -from types import CoroutineType from aiokafka import AIOKafkaConsumer, AIOKafkaProducer from .errors import KafkaTransportError @@ -104,7 +103,7 @@ async def consume_messages(consumer: AIOKafkaConsumer, callback): "key": decode_key(msg.key), "value": value }) - if type(result) is CoroutineType: + if asyncio.iscoroutine(result): asyncio.ensure_future(result) except: logger.warning("Error during calling handler with data: %s", str(value)) diff --git a/setup.py b/setup.py index 9e92482..60c2ad2 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ long_description = fh.read() setup(name='kafka-transport', - version='0.6.4', + version='0.6.5', long_description=long_description, long_description_content_type="text/markdown", url='https://github.com/Karma-blockchain/kafka-transport',