Ignored only the rules about continuing / hanging indentation. Also, added __init__.py to tests so that pylint discovers them. (I don't buy pytest's BS about installing your package.)
9 lines
220 B
Python
9 lines
220 B
Python
import urllib.request
|
|
|
|
|
|
def download(url):
|
|
assert url
|
|
request = urllib.request.Request(url)
|
|
request.add_header('Referer', url)
|
|
with urllib.request.urlopen(request) as handle:
|
|
return handle.read()
|