]> arthur.barton.de Git - bup.git/blobdiff - lib/cmd/import-duplicity-cmd.py
Remove $(dirname "$0") from sys.path
[bup.git] / lib / cmd / import-duplicity-cmd.py
index 348be8cbbaa397b9620ca4b1ea3b2e67dd475d16..40cbda246985a9b4dcbbd64dfeab435d83655af6 100755 (executable)
@@ -15,17 +15,17 @@ exec "$bup_python" "$0"
 # end of bup preamble
 
 from __future__ import absolute_import
+
+# Intentionally replace the dirname "$0" that python prepends
+import os, sys
+sys.path[0] = os.path.dirname(os.path.realpath(__file__)) + '/..'
+
 from calendar import timegm
 from pipes import quote
 from subprocess import check_call
 from time import strftime, strptime
-import os
-import os.path
-import sys
 import tempfile
 
-sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
-
 from bup import compat, git, helpers, options
 from bup.compat import argv_bytes, str_type
 from bup.helpers import (handle_ctrl_c,