Commit 5488aff 1 parent e99b0e3 commit 5488aff Copy full SHA for 5488aff
File tree 1 file changed +4
-3
lines changed
1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 22
22
import pefile
23
23
import json
24
24
import gzip
25
- import urllib
25
+ import urllib . request
26
26
import binascii
27
27
import base64
28
+ import shutil
28
29
from collections import Counter
29
30
from hashlib import sha256
30
31
import signal as signal_module
@@ -1890,8 +1891,8 @@ def update_databases():
1890
1891
try :
1891
1892
for filename , repo_url in REPO_URLS .items ():
1892
1893
print ("Downloading %s from %s ..." % (filename , repo_url ))
1893
- fileDownloader = urllib .URLopener ()
1894
- fileDownloader . retrieve ( repo_url , "./dbs/%s" % filename )
1894
+ with urllib .request . urlopen ( repo_url ) as response , open ( "./dbs/%s" % filename , 'wb' ) as out_file :
1895
+ shutil . copyfileobj ( response , out_file )
1895
1896
except Exception as e :
1896
1897
if args .debug :
1897
1898
traceback .print_exc ()
You can’t perform that action at this time.
0 commit comments