# end of bup preamble
from __future__ import absolute_import, print_function
-import os, glob, subprocess, sys
+
+# Intentionally replace the dirname "$0" that python prepends
+import os, sys
+sys.path[0] = os.path.dirname(os.path.realpath(__file__)) + '/..'
+
+import glob, subprocess
from shutil import rmtree
from subprocess import PIPE, Popen
from tempfile import mkdtemp
from binascii import hexlify
-sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
-
from bup import compat, options, git
from bup.compat import argv_bytes
from bup.helpers import Sha1, chunkyreader, istty2, log, progress