]> arthur.barton.de Git - bup.git/blobdiff - lib/cmd/xstat-cmd.py
Remove $(dirname "$0") from sys.path
[bup.git] / lib / cmd / xstat-cmd.py
index 8a56ba58deac41202ba069336767b3ad1cdd80f7..4a2bffab259b898bbdbfcb61c525ae123ce638d5 100755 (executable)
@@ -9,7 +9,7 @@ for arg in "$@"; do
     arg_i=$((arg_i + 1))
 done
 # Here to end of preamble replaced during install
-bup_python="$(dirname "$0")/bup-python" || exit $?
+bup_python="$(dirname "$0")/../../config/bin/python" || exit $?
 exec "$bup_python" "$0"
 """
 # end of bup preamble
@@ -20,9 +20,12 @@ exec "$bup_python" "$0"
 # Public License as described in the bup LICENSE file.
 
 from __future__ import absolute_import, print_function
-import errno, os.path, sys, stat
 
-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 errno, os.path, stat
 
 from bup import compat, metadata, options, xstat
 from bup.compat import argv_bytes