# end of bup preamble
from __future__ import absolute_import
-import glob, os, sys, tempfile
-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 glob, tempfile
from bup import compat, options, git, bloom
from bup.compat import argv_bytes, hexstr