Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas-Karl Pietrowski <thopiekar@googlemail.com>2016-04-21 20:09:15 +0300
committerThomas-Karl Pietrowski <thopiekar@googlemail.com>2016-04-21 20:09:15 +0300
commit1a5245416512441097b90104cecc8bf84e4b81b6 (patch)
tree10a3139bfc42b87a7286b4eb4b024ba7b3da1401 /cura_app.py
parent61069e9a71c57a65eded4d9a9dc1213fd92e1d88 (diff)
This should be fine now..
Diffstat (limited to 'cura_app.py')
-rwxr-xr-xcura_app.py20
1 files changed, 8 insertions, 12 deletions
diff --git a/cura_app.py b/cura_app.py
index 6c20910907..bd820337f2 100755
--- a/cura_app.py
+++ b/cura_app.py
@@ -13,18 +13,14 @@ import sys
# This can cause issues such as having libsip loaded from
# the system instead of the one provided with Cura, which causes
# incompatibility issues with libArcus
-if "PYTHONPATH" in os.environ.keys(): # If PYTHONPATH is used
- 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.
- sys.path.remove(PYTHONPATH_real) # If so, remove that element..
- sys.path.insert(1, PYTHONPATH_real) # and add it at the correct place again.
-
+if "PYTHONPATH" in os.environ.keys(): # If PYTHONPATH is used
+ PYTHONPATH = os.environ["PYTHONPATH"].split(os.pathsep) # Get the value, split it..
+ PYTHONPATH = PYTHONPATH.reverse() # and reverse it, because we always insert at 1
+ for PATH in PYTHONPATH: # Now beginning with the last PATH
+ PATH_real = os.path.realpath(PATH) # Making the the path "real"
+ if PATH_real in sys.path: # This should always work, but keep it to be sure..
+ sys.path.remove(PATH_real)
+ sys.path.insert(1, PATH_real) # Insert it at 1 before os.curdir, which is 0.
def exceptHook(hook_type, value, traceback):
import cura.CrashHandler