Fixing security error on MacOS for AddonManager, see https://forum.freecadweb.org/viewtopic.php?f=3&t=24898

This commit is contained in:
PLChris
2017-10-29 12:00:52 +01:00
committed by Yorik van Havre
parent d26c3966bd
commit 339dd6b6a1

View File

@@ -766,7 +766,10 @@ class InstallWorker(QtCore.QThread):
depsurl += "/"
depsurl += "master/metadata.txt"
try:
mu = urllib2.urlopen(depsurl)
if ctx:
mu = urllib2.urlopen(depsurl,context=ctx)
else:
mu = urllib2.urlopen(depsurl)
except urllib2.HTTPError:
# no metadata.txt, we just continue without deps checking
pass
@@ -823,7 +826,10 @@ class InstallWorker(QtCore.QThread):
zipurl = giturl+"/archive/master.zip"
try:
print("Downloading "+zipurl)
u = urllib2.urlopen(zipurl)
if ctx:
u = urllib2.urlopen(zipurl,context=ctx)
else:
u = urllib2.urlopen(zipurl)
except:
return translate("AddonsInstaller", "Error: Unable to download") + " " + zipurl
zfile = io.StringIO()