Skip to content

Commit 5a2b188

Browse files
committed
Fix line length in error message
1 parent 51cb6bd commit 5a2b188

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

httpx/_content.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,9 +208,11 @@ def encode_request(
208208
# Check if it's a list/tuple of bytes
209209
for item in data:
210210
if not isinstance(item, (bytes, bytearray, memoryview)):
211+
item_type = type(item).__name__
211212
raise TypeError(
212-
f"Expected bytes-like object in 'data' sequence, got {type(item).__name__}. "
213-
f"Use 'json=' for JSON data or 'data={{...}}' for form data."
213+
f"Expected bytes-like object in 'data' sequence, "
214+
f"got {item_type}. Use 'json=' for JSON data or "
215+
f"'data={{...}}' for form data."
214216
)
215217

216218
message = "Use 'content=<...>' to upload raw bytes/text content."

0 commit comments

Comments
 (0)