Skip to content

Commit

Permalink
fix: bug in update function (still used Python 2 functions)
Browse files Browse the repository at this point in the history
  • Loading branch information
Neo23x0 committed Jul 15, 2020
1 parent e99b0e3 commit 5488aff
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions yarGen.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@
import pefile
import json
import gzip
import urllib
import urllib.request
import binascii
import base64
import shutil
from collections import Counter
from hashlib import sha256
import signal as signal_module
Expand Down Expand Up @@ -1890,8 +1891,8 @@ def update_databases():
try:
for filename, repo_url in REPO_URLS.items():
print("Downloading %s from %s ..." % (filename, repo_url))
fileDownloader = urllib.URLopener()
fileDownloader.retrieve(repo_url, "./dbs/%s" % filename)
with urllib.request.urlopen(repo_url) as response, open("./dbs/%s" % filename, 'wb') as out_file:
shutil.copyfileobj(response, out_file)
except Exception as e:
if args.debug:
traceback.print_exc()
Expand Down

0 comments on commit 5488aff

Please sign in to comment.