]> arthur.barton.de Git - bup.git/blobdiff - lib/cmd/on--server-cmd.py
Remove $(dirname "$0") from sys.path
[bup.git] / lib / cmd / on--server-cmd.py
index 0c151b0f1655229094cc2723b9eac3fed45cc84f..39407155a896545750c4ddd577c8bc2cb7ba957e 100755 (executable)
@@ -15,9 +15,12 @@ exec "$bup_python" "$0"
 # end of bup preamble
 
 from __future__ import absolute_import
-import os, struct, sys
 
-sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
+# Intentionally replace the dirname "$0" that python prepends
+import os, sys
+sys.path[0] = os.path.dirname(os.path.realpath(__file__)) + '/..'
+
+import struct
 
 from bup import compat, options, helpers, path
 from bup.compat import environ, py_maj