mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-07-07 06:11:48 +08:00
This should be fine now..
This commit is contained in:
parent
61069e9a71
commit
1a52454165
18
cura_app.py
18
cura_app.py
@ -14,17 +14,13 @@ import sys
|
|||||||
# the system instead of the one provided with Cura, which causes
|
# the system instead of the one provided with Cura, which causes
|
||||||
# incompatibility issues with libArcus
|
# incompatibility issues with libArcus
|
||||||
if "PYTHONPATH" in os.environ.keys(): # If PYTHONPATH is used
|
if "PYTHONPATH" in os.environ.keys(): # If PYTHONPATH is used
|
||||||
PYTHONPATH = os.environ["PYTHONPATH"]
|
PYTHONPATH = os.environ["PYTHONPATH"].split(os.pathsep) # Get the value, split it..
|
||||||
PYTHONPATH = PYTHONPATH.split(os.pathsep)
|
PYTHONPATH = PYTHONPATH.reverse() # and reverse it, because we always insert at 1
|
||||||
PYTHONPATH_real = os.path.realpath(PYTHONPATH[0])
|
for PATH in PYTHONPATH: # Now beginning with the last PATH
|
||||||
PYTHONPATH = PYTHONPATH[1:]
|
PATH_real = os.path.realpath(PATH) # Making the the path "real"
|
||||||
while PYTHONPATH:
|
if PATH_real in sys.path: # This should always work, but keep it to be sure..
|
||||||
PYTHONPATH_real += ":%s" %(os.path.realpath(PYTHONPATH[0]))
|
sys.path.remove(PATH_real)
|
||||||
PYTHONPATH = PYTHONPATH[1:]
|
sys.path.insert(1, PATH_real) # Insert it at 1 before os.curdir, which is 0.
|
||||||
if sys.path[1] != PYTHONPATH_real: # .. check whether PYTHONPATH is placed incorrectly.
|
|
||||||
sys.path.remove(PYTHONPATH_real) # If so, remove that element..
|
|
||||||
sys.path.insert(1, PYTHONPATH_real) # and add it at the correct place again.
|
|
||||||
|
|
||||||
|
|
||||||
def exceptHook(hook_type, value, traceback):
|
def exceptHook(hook_type, value, traceback):
|
||||||
import cura.CrashHandler
|
import cura.CrashHandler
|
||||||
|
Loading…
x
Reference in New Issue
Block a user