summaryrefslogtreecommitdiffstats
path: root/Lib/urllib/request.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/urllib/request.py')
-rw-r--r--Lib/urllib/request.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/urllib/request.py b/Lib/urllib/request.py
index 7a5b0e2..a5f0866 100644
--- a/Lib/urllib/request.py
+++ b/Lib/urllib/request.py
@@ -1172,8 +1172,9 @@ class AbstractHTTPHandler(BaseHandler):
if request.data is not None: # POST
data = request.data
if isinstance(data, str):
- raise TypeError("POST data should be bytes"
- " or an iterable of bytes. It cannot be str.")
+ msg = "POST data should be bytes or an iterable of bytes."\
+ "It cannot be str"
+ raise TypeError(msg)
if not request.has_header('Content-type'):
request.add_unredirected_header(
'Content-type',