urllib.request: fix spacing errors in exception/warning messages.

This commit is contained in:
Georg Brandl 2012-06-24 19:56:31 +02:00
parent 56261cff16
commit fcbdbf22e3
1 changed files with 5 additions and 5 deletions

View File

@ -785,7 +785,7 @@ class ProxyHandler(BaseHandler):
self.proxies = proxies
for type, url in proxies.items():
setattr(self, '%s_open' % type,
lambda r, proxy=url, type=type, meth=self.proxy_open: \
lambda r, proxy=url, type=type, meth=self.proxy_open:
meth(r, proxy, type))
def proxy_open(self, req, proxy, type):
@ -1179,7 +1179,7 @@ class AbstractHTTPHandler(BaseHandler):
data = request.data
if isinstance(data, str):
msg = "POST data should be bytes or an iterable of bytes. " \
"It cannot be str"
"It cannot be of type str."
raise TypeError(msg)
if not request.has_header('Content-type'):
request.add_unredirected_header(