]> arthur.barton.de Git - bup.git/blobdiff - lib/cmd/version-cmd.py
Remove $(dirname "$0") from sys.path
[bup.git] / lib / cmd / version-cmd.py
index bc1329c7cce8bf5c4ca230894ce1da3242b69d14..d406712548dbb683ad0b6dc6f186cf74f7b2d4e5 100755 (executable)
@@ -15,9 +15,12 @@ exec "$bup_python" "$0"
 # end of bup preamble
 
 from __future__ import absolute_import, print_function
-import os.path, re, 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 re
 
 from bup import compat, options, version
 from bup.io import byte_stream