Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fcbdbf2

Browse files
committed
urllib.request: fix spacing errors in exception/warning messages.
1 parent 56261cf commit fcbdbf2

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

Lib/urllib/request.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -785,8 +785,8 @@ def __init__(self, proxies=None):
785785
self.proxies = proxies
786786
for type, url in proxies.items():
787787
setattr(self, '%s_open' % type,
788-
lambda r, proxy=url, type=type, meth=self.proxy_open: \
789-
meth(r, proxy, type))
788+
lambda r, proxy=url, type=type, meth=self.proxy_open:
789+
meth(r, proxy, type))
790790

791791
def proxy_open(self, req, proxy, type):
792792
orig_type = req.type
@@ -1178,8 +1178,8 @@ def do_request_(self, request):
11781178
if request.data is not None: # POST
11791179
data = request.data
11801180
if isinstance(data, str):
1181-
msg = "POST data should be bytes or an iterable of bytes."\
1182-
"It cannot be str"
1181+
msg = "POST data should be bytes or an iterable of bytes. " \
1182+
"It cannot be of type str."
11831183
raise TypeError(msg)
11841184
if not request.has_header('Content-type'):
11851185
request.add_unredirected_header(
@@ -1576,7 +1576,7 @@ class URLopener:
15761576

15771577
# Constructor
15781578
def __init__(self, proxies=None, **x509):
1579-
msg = "%(class)s style of invoking requests is deprecated."\
1579+
msg = "%(class)s style of invoking requests is deprecated. " \
15801580
"Use newer urlopen functions/methods" % {'class': self.__class__.__name__}
15811581
warnings.warn(msg, DeprecationWarning, stacklevel=3)
15821582
if proxies is None:

0 commit comments

Comments
 (0)