]> arthur.barton.de Git - bup.git/blobdiff - lib/cmd/index-cmd.py
Remove $(dirname "$0") from sys.path
[bup.git] / lib / cmd / index-cmd.py
index 8941ecbf400a5c0e17b1db2263994be09c61b032..a61349b5f328b813a6a3345ec9536831ec94be67 100755 (executable)
@@ -15,10 +15,13 @@ exec "$bup_python" "$0"
 # end of bup preamble
 
 from __future__ import absolute_import, print_function
-from binascii import hexlify
-import errno, os, re, stat, sys, time
 
-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__)) + '/..'
+
+from binascii import hexlify
+import errno, re, stat, time
 
 from bup import compat, metadata, options, git, index, drecurse, hlinkdb
 from bup.compat import argv_bytes