diff --git a/src/allmydata/storage/http_client.py b/src/allmydata/storage/http_client.py index 41a2dd0b8..99275ae24 100644 --- a/src/allmydata/storage/http_client.py +++ b/src/allmydata/storage/http_client.py @@ -123,7 +123,11 @@ class StorageClient(object): # If there's a request message, serialize it and set the Content-Type # header: if message_to_serialize is not None: - assert "data" not in kwargs + if "data" in kwargs: + raise TypeError( + "Can't use both `message_to_serialize` and `data` " + "as keyword arguments at the same time" + ) kwargs["data"] = dumps(message_to_serialize) headers.addRawHeader("Content-Type", CBOR_MIME_TYPE)