Skip to content

Commit

Permalink
Make delivery_tag non-optional (#498)
Browse files Browse the repository at this point in the history
  • Loading branch information
gmr committed May 20, 2015
1 parent 851ee1c commit 9040a14
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pika/channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ def basic_qos(self,
all_channels), callback,
[spec.Basic.QosOk])

def basic_reject(self, delivery_tag=None, requeue=True):
def basic_reject(self, delivery_tag, requeue=True):
"""Reject an incoming message. This method allows a client to reject a
message. It can be used to interrupt and cancel large incoming messages,
or return untreatable messages to their original queue.
Expand All @@ -356,10 +356,13 @@ def basic_reject(self, delivery_tag=None, requeue=True):
requeue the message. If requeue is false or the
requeue attempt fails the messages are discarded or
dead-lettered.
:raises: TypeError
"""
if not self.is_open:
raise exceptions.ChannelClosed()
if not isinstance(delivery_tag, int):
raise TypeError('delivery_tag must be an integer')
return self._send_method(spec.Basic.Reject(delivery_tag, requeue))

def basic_recover(self, callback=None, requeue=False):
Expand Down

0 comments on commit 9040a14

Please sign in to comment.