]> arthur.barton.de Git - bup.git/blobdiff - lib/cmd/save-cmd.py
Remove $(dirname "$0") from sys.path
[bup.git] / lib / cmd / save-cmd.py
index 37155cb2e2a66ca68e4808790d828836e397be20..09dfc211fda14f9620d14695d07dae2eb85c795b 100755 (executable)
@@ -15,12 +15,15 @@ exec "$bup_python" "$0"
 # end of bup preamble
 
 from __future__ import absolute_import, print_function
+
+# 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
 from errno import EACCES
 from io import BytesIO
-import math, os, stat, sys, time
-
-sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
+import math, stat, time
 
 from bup import compat, hashsplit, git, options, index, client, metadata
 from bup import hlinkdb