# end of bup preamble
from __future__ import absolute_import, print_function
-from binascii import hexlify
-import errno, os, re, stat, sys, time
-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__)) + '/..'
+
+from binascii import hexlify
+import errno, re, stat, time
from bup import compat, metadata, options, git, index, drecurse, hlinkdb
from bup.compat import argv_bytes