# (e.g. ISO-8859-1).
from __future__ import absolute_import, print_function
-import os, fnmatch, stat, 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 fnmatch, stat
from bup import _helpers, compat, options, git, shquote, ls, vfs
from bup.compat import argv_bytes, fsdecode