mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 04:59:00 +08:00
Making sure we got the realpath when using an absolute path
This commit is contained in:
parent
8c0d7aea8a
commit
98c84798c6
@ -14,9 +14,10 @@ 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
|
||||||
if sys.path[1] != os.environ["PYTHONPATH"]: # .. check whether PYTHONPATH is placed incorrectly.
|
PYTHONPATH_real = os.path.realpath(os.environ["PYTHONPATH"])
|
||||||
sys.path.remove(os.environ["PYTHONPATH"]) # If so, remove that element..
|
if sys.path[1] != PYTHONPATH_real: # .. check whether PYTHONPATH is placed incorrectly.
|
||||||
sys.path.insert(1, os.environ['PYTHONPATH']) # and add it at the correct place again.
|
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):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user