]> arthur.barton.de Git - bup.git/blobdiff - lib/cmd/ftp-cmd.py
Remove $(dirname "$0") from sys.path
[bup.git] / lib / cmd / ftp-cmd.py
index 02a6fecef014609806e827c0c3a0b7aa222a6c1e..275ecb2c51a9bb6735c89fa081593035e921721f 100755 (executable)
@@ -20,9 +20,12 @@ exec "$bup_python" "$0"
 # (e.g. ISO-8859-1).
 
 from __future__ import absolute_import, print_function
-import os, fnmatch, stat, 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 fnmatch, stat
 
 from bup import _helpers, compat, options, git, shquote, ls, vfs
 from bup.compat import argv_bytes, fsdecode