Skip to content

Commit

Permalink
channel: check for a coroutine function
Browse files Browse the repository at this point in the history
  • Loading branch information
dzen committed Sep 8, 2014
1 parent 544cdba commit ff74ee7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions aioamqp/channel.py
Expand Up @@ -517,8 +517,8 @@ def basic_consume(self, queue_name='', consumer_tag='', no_local=False, no_ack=F
if arguments is None:
arguments = {}

if callback is None or not asyncio.iscoroutine(callback()):
raise exceptions.ConfigurationError("basic_consume requires a callback")
if callback is None or not asyncio.iscoroutinefunction(callback):
raise exceptions.ConfigurationError("basic_consume requires a coroutine callback")

frame = amqp_frame.AmqpRequest(
self.protocol.writer, amqp_constants.TYPE_METHOD, self.channel_id)
Expand Down

0 comments on commit ff74ee7

Please sign in to comment.