mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-04-19 04:09:40 +08:00
Import Arcus before importing Cura (and PyQt5)
Workaround an issue on certain Linux systems that causes a race condition between Arcus and PyQt5. Contributes to CURA-434
This commit is contained in:
parent
894624fc2d
commit
041fa2b359
15
cura_app.py
15
cura_app.py
@ -12,15 +12,12 @@ def exceptHook(type, value, traceback):
|
|||||||
|
|
||||||
sys.excepthook = exceptHook
|
sys.excepthook = exceptHook
|
||||||
|
|
||||||
try:
|
# Workaround for a race condition on certain systems where there
|
||||||
from google.protobuf.pyext import _message
|
# is a race condition between Arcus and PyQt. Importing Arcus
|
||||||
except ImportError:
|
# first seems to prevent Sip from going into a state where it
|
||||||
pass
|
# tries to create PyQt objects on a non-main thread.
|
||||||
else:
|
import Arcus
|
||||||
os.environ["PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION"] = "cpp"
|
import cura.CuraApplication
|
||||||
|
|
||||||
if True: # To make the code style checker stop complaining
|
|
||||||
import cura.CuraApplication
|
|
||||||
|
|
||||||
if sys.platform == "win32" and hasattr(sys, "frozen"):
|
if sys.platform == "win32" and hasattr(sys, "frozen"):
|
||||||
import os
|
import os
|
||||||
|
Loading…
x
Reference in New Issue
Block a user