Skip to content

Commit 4246b2a

Browse files
committed
Cosmetics for #59
1 parent 8ec33c2 commit 4246b2a

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

Modules/_librabbitmq/connection.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1340,11 +1340,14 @@ PyRabbitMQ_recv(PyRabbitMQ_Connection *self, PyObject *p,
13401340
*buf++ = *bufp++, j++);
13411341
}
13421342
if (p) {
1343-
if (body_target && !payload) //We expected content, got none
1344-
goto error;
1345-
else if (!payload) //We expected no content, return emptystring
1343+
if (!payload) {
1344+
/* expected content, got none */
1345+
if (body_target) goto error;
1346+
1347+
/* did not expect content, return empty string */
13461348
payload = PyString_FromStringAndSize(NULL, 0);
1347-
1349+
}
1350+
13481351
PyDict_SetItemString(p, "properties", propdict);
13491352
PyDict_SetItemString(p, "body", payload);
13501353
PyDict_SetItemString(p, "channel", channel);

0 commit comments

Comments
 (0)