]> arthur.barton.de Git - bup.git/blobdiff - lib/cmd/random-cmd.py
Remove $(dirname "$0") from sys.path
[bup.git] / lib / cmd / random-cmd.py
index 62889a2ffc3c4901211cfdd2e0ed41d06c98fcdf..9d30c987f3c1a909d2beffa0d26cca11baf5efbe 100755 (executable)
@@ -15,9 +15,10 @@ exec "$bup_python" "$0"
 # end of bup preamble
 
 from __future__ import absolute_import
-import os, 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__)) + '/..'
 
 from bup import compat, options, _helpers
 from bup.helpers import handle_ctrl_c, log, parse_num