mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-13 04:29:01 +08:00
Making the fix working with a list of PATHS seperated by os.pathsep
Needs testing but should work. (fingers crossed)
This commit is contained in:
parent
286673e812
commit
61069e9a71
@ -14,7 +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_real = os.path.realpath(os.environ["PYTHONPATH"])
|
PYTHONPATH = os.environ["PYTHONPATH"]
|
||||||
|
PYTHONPATH = PYTHONPATH.split(os.pathsep)
|
||||||
|
PYTHONPATH_real = os.path.realpath(PYTHONPATH[0])
|
||||||
|
PYTHONPATH = PYTHONPATH[1:]
|
||||||
|
while PYTHONPATH:
|
||||||
|
PYTHONPATH_real += ":%s" %(os.path.realpath(PYTHONPATH[0]))
|
||||||
|
PYTHONPATH = PYTHONPATH[1:]
|
||||||
if sys.path[1] != PYTHONPATH_real: # .. check whether PYTHONPATH is placed incorrectly.
|
if sys.path[1] != PYTHONPATH_real: # .. check whether PYTHONPATH is placed incorrectly.
|
||||||
sys.path.remove(PYTHONPATH_real) # If so, remove that element..
|
sys.path.remove(PYTHONPATH_real) # If so, remove that element..
|
||||||
sys.path.insert(1, PYTHONPATH_real) # and add it at the correct place again.
|
sys.path.insert(1, PYTHONPATH_real) # and add it at the correct place again.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user