summaryrefslogtreecommitdiffstats
path: root/pyload/InitHomeDir.py
diff options
context:
space:
mode:
authorGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-06-09 22:55:07 +0200
committerGravatar RaNaN <Mast3rRaNaN@hotmail.de> 2013-06-09 22:55:07 +0200
commit24b6d28baf559e151fc96ce2c15d17dfd78da479 (patch)
tree6dfc34734f3fc10a89ea66304795da4fb51fb7e2 /pyload/InitHomeDir.py
parentfixing imports when changing cwd (diff)
downloadpyload-24b6d28baf559e151fc96ce2c15d17dfd78da479.tar.xz
fixed start scripts
Diffstat (limited to 'pyload/InitHomeDir.py')
-rw-r--r--pyload/InitHomeDir.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/pyload/InitHomeDir.py b/pyload/InitHomeDir.py
index 3554497d3..c255913de 100644
--- a/pyload/InitHomeDir.py
+++ b/pyload/InitHomeDir.py
@@ -31,7 +31,10 @@ __builtin__.pypath = path.abspath(path.join(__file__, "..", ".."))
# Before changing the cwd, the abspath of the module must be manifested
if 'pyload' in sys.modules:
- sys.modules['pyload'].__path__.append(path.abspath(sys.modules['pyload'].__path__[0]))
+ rel_pyload = sys.modules['pyload'].__path__[0]
+ abs_pyload = path.abspath(rel_pyload)
+ if abs_pyload != rel_pyload:
+ sys.modules['pyload'].__path__.insert(0, abs_pyload)
sys.path.append(join(pypath, "pyload", "lib"))