Commits

Anonymous committed 4c35356

Return reply if want_receipt=True

  • Participants
  • Parent commits 913cbdd

Comments (0)

Files changed (1)

         """
         headers = dict(conf)
         body = headers.pop("body", "")
-        frame = self._send_command("SEND", headers, extra={"body": body},
-                                   want_receipt=True)
-        return frame
+        return self._send_command("SEND", headers, extra={"body": body},
+                                  want_receipt=True)
 
     def _build_frame(self, *args, **kwargs):
         self._connected_or_raise()
         frame_conf = {"command": command, "headers": conf}
         frame_conf.update(extra)
         frame = self._build_frame(frame_conf, **kwargs)
-        self.send_frame(frame)
+        reply = self.send_frame(frame)
+        if kwargs.get("want_receipt", False):
+            return reply
         return frame
 
     def _connected_or_raise(self):