File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 2222import pefile
2323import json
2424import gzip
25- import urllib
25+ import urllib . request
2626import binascii
2727import base64
28+ import shutil
2829from collections import Counter
2930from hashlib import sha256
3031import signal as signal_module
@@ -1890,8 +1891,8 @@ def update_databases():
18901891 try :
18911892 for filename , repo_url in REPO_URLS .items ():
18921893 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 )
18951896 except Exception as e :
18961897 if args .debug :
18971898 traceback .print_exc ()
You can’t perform that action at this time.
0 commit comments