mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-04-23 06:09:38 +08:00
CURA-1831: Adding only the basic workaround for OSX
This commit is contained in:
parent
21ae73fca0
commit
a854554d94
@ -9,6 +9,7 @@ from UM.Scene.SceneNode import SceneNode
|
|||||||
from UM.Message import Message
|
from UM.Message import Message
|
||||||
from UM.i18n import i18nCatalog
|
from UM.i18n import i18nCatalog
|
||||||
from UM.Logger import Logger
|
from UM.Logger import Logger
|
||||||
|
from UM.Platform import Platform
|
||||||
|
|
||||||
import collections
|
import collections
|
||||||
import json
|
import json
|
||||||
@ -18,6 +19,7 @@ import platform
|
|||||||
import math
|
import math
|
||||||
import urllib.request
|
import urllib.request
|
||||||
import urllib.parse
|
import urllib.parse
|
||||||
|
import ssl
|
||||||
|
|
||||||
catalog = i18nCatalog("cura")
|
catalog = i18nCatalog("cura")
|
||||||
|
|
||||||
@ -111,8 +113,13 @@ class SliceInfo(Extension):
|
|||||||
binary_data = submitted_data.encode("utf-8")
|
binary_data = submitted_data.encode("utf-8")
|
||||||
|
|
||||||
# Submit data
|
# Submit data
|
||||||
|
kwoptions = {"data" : binary_data,
|
||||||
|
"timeout" : 1
|
||||||
|
}
|
||||||
|
if Platform.isOSX():
|
||||||
|
kwoptions["context"] = ssl._create_unverified_context()
|
||||||
try:
|
try:
|
||||||
f = urllib.request.urlopen(self.info_url, data = binary_data, timeout = 1)
|
f = urllib.request.urlopen(self.info_url, **kwoptions)
|
||||||
Logger.log("i", "Sent anonymous slice info to %s", self.info_url)
|
Logger.log("i", "Sent anonymous slice info to %s", self.info_url)
|
||||||
f.close()
|
f.close()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user