mirror of
https://forge.chapril.org/tykayn/mapillary_download
synced 2025-06-20 01:34:43 +02:00
move inside the with block
This commit is contained in:
parent
e3140c607a
commit
396570ff46
1 changed files with 2 additions and 2 deletions
|
@ -37,9 +37,9 @@ def background(f):
|
||||||
|
|
||||||
#@background
|
#@background
|
||||||
def download(url, filepath, metadata=None):
|
def download(url, filepath, metadata=None):
|
||||||
|
with open(str(filepath), "wb") as f:
|
||||||
r = session.get(url, stream=True, timeout=6)
|
r = session.get(url, stream=True, timeout=6)
|
||||||
image = write_exif(r.content, metadata)
|
image = write_exif(r.content, metadata)
|
||||||
with open(str(filepath), "wb") as f:
|
|
||||||
f.write(image)
|
f.write(image)
|
||||||
print("{} downloaded".format(filepath))
|
print("{} downloaded".format(filepath))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue