Jelmer Vernooij 3 vuotta sitten
vanhempi
commit
ae3e7f9252
1 muutettua tiedostoa jossa 3 lisäystä ja 2 poistoa
  1. 3 2
      dulwich/tests/test_repository.py

+ 3 - 2
dulwich/tests/test_repository.py

@@ -647,7 +647,8 @@ exit 0
             self.skipTest("shell hook tests requires POSIX shell")
 
         pre_commit_contents = """#!%(executable)s
-import os
+import sys
+sys.path.extend(':'.join(%(path)s))
 from dulwich.repo import Repo
 
 with open('foo', 'w') as f:
@@ -655,7 +656,7 @@ with open('foo', 'w') as f:
 
 r = Repo('.')
 r.stage(['foo'])
-""" % {'executable': sys.executable}
+""" % {'executable': sys.executable, 'path': repr(sys.path)}
 
         repo_dir = os.path.join(self.mkdtemp())
         self.addCleanup(shutil.rmtree, repo_dir)