We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e99b0e3 commit 5488affCopy full SHA for 5488aff
1 file changed
yarGen.py
@@ -22,9 +22,10 @@
22
import pefile
23
import json
24
import gzip
25
-import urllib
+import urllib.request
26
import binascii
27
import base64
28
+import shutil
29
from collections import Counter
30
from hashlib import sha256
31
import signal as signal_module
@@ -1890,8 +1891,8 @@ def update_databases():
1890
1891
try:
1892
for filename, repo_url in REPO_URLS.items():
1893
print("Downloading %s from %s ..." % (filename, repo_url))
- fileDownloader = urllib.URLopener()
1894
- fileDownloader.retrieve(repo_url, "./dbs/%s" % filename)
+ with urllib.request.urlopen(repo_url) as response, open("./dbs/%s" % filename, 'wb') as out_file:
1895
+ shutil.copyfileobj(response, out_file)
1896
except Exception as e:
1897
if args.debug:
1898
traceback.print_exc()
0 commit comments