diff options
Diffstat (limited to 'Lib/urllib.py')
-rw-r--r-- | Lib/urllib.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/urllib.py b/Lib/urllib.py index c6bd87f..dcd906c 100644 --- a/Lib/urllib.py +++ b/Lib/urllib.py @@ -245,7 +245,7 @@ class URLopener: reporthook(blocknum, bs, size) while 1: block = fp.read(bs) - if block == "": + if not block: break read += len(block) tfp.write(block) @@ -976,7 +976,7 @@ def toBytes(url): def unwrap(url): """unwrap('<URL:type://host/path>') --> 'type://host/path'.""" - url = url.strip() + url = str(url).strip() if url[:1] == '<' and url[-1:] == '>': url = url[1:-1].strip() if url[:4] == 'URL:': url = url[4:].strip() |