mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-01-31 08:25:35 +00:00
Switch to TypeError.
This commit is contained in:
parent
fae9556e3d
commit
7de3d93b0e
@ -123,7 +123,11 @@ class StorageClient(object):
|
|||||||
# If there's a request message, serialize it and set the Content-Type
|
# If there's a request message, serialize it and set the Content-Type
|
||||||
# header:
|
# header:
|
||||||
if message_to_serialize is not None:
|
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)
|
kwargs["data"] = dumps(message_to_serialize)
|
||||||
headers.addRawHeader("Content-Type", CBOR_MIME_TYPE)
|
headers.addRawHeader("Content-Type", CBOR_MIME_TYPE)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user