vmm: Don't insert the module directory into sys.path by default. v0.6.x
authorPascal Volk <user@localhost.localdomain.org>
Thu, 28 Jun 2012 18:48:37 +0000
branchv0.6.x
changeset 569 54a84a311654
parent 568 14abdd04ddf5
child 570 28230a8230bf
vmm: Don't insert the module directory into sys.path by default. Doesn't make much sense, if the code is installed inside sys.path.
vmm
--- a/vmm	Thu Jun 28 18:33:32 2012 +0000
+++ b/vmm	Thu Jun 28 18:48:37 2012 +0000
@@ -9,7 +9,10 @@
 
 if __name__ == '__main__':
     # replace the script's cwd (/usr/local/sbin) with our module dir
-    # (the location of the VirtualMailManager directory)
-    sys.path[0] = '/usr/local/lib/vmm'
+    # (the location of the VirtualMailManager directory) - if it is
+    # not in sys.path
+    #sys.path[0] = '/usr/local/lib/vmm'
+    # Otherwise just remove /usr/local/sbin from sys.path
+    sys.path.remove(sys.path[0])
     from VirtualMailManager.cli.main import run
     sys.exit(run(sys.argv))