Commit 46f518b5 authored by André Anjos's avatar André Anjos 💬
Browse files

[python2.6] Backward syntax compatibility

parent f658f57c
......@@ -86,8 +86,9 @@ class Database():
# python3 technique for downloading a file
from urllib.request import urlopen
from shutil import copyfileobj
with urlopen(url) as response, open(tmp_file, 'wb') as out_file:
copyfileobj(response, out_file)
with urlopen(url) as response:
with open(tmp_file, 'wb') as out_file:
copyfileobj(response, out_file)
return tmp_directory
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment