Browse Source

Fix Python3 compatibility.

Jelmer Vernooij 8 years ago
parent
commit
a725196c16
2 changed files with 4 additions and 2 deletions
  1. 3 1
      dulwich/porcelain.py
  2. 1 1
      dulwich/tests/test_porcelain.py

+ 3 - 1
dulwich/porcelain.py

@@ -227,7 +227,9 @@ def init(path=".", bare=False):
         return Repo.init(path)
 
 
-def clone(source, target=None, bare=False, checkout=None, errstream=default_bytes_err_stream, outstream=None, origin="origin"):
+def clone(source, target=None, bare=False, checkout=None,
+          errstream=default_bytes_err_stream, outstream=None,
+          origin=b"origin"):
     """Clone a local or remote git repository.
 
     :param source: Path or URL for source repository

+ 1 - 1
dulwich/tests/test_porcelain.py

@@ -121,7 +121,7 @@ class CloneTests(PorcelainTestCase):
         self.assertEqual(r.path, target_path)
         target_repo = Repo(target_path)
         self.assertEqual(target_repo.head(), c3.id)
-        self.assertEquals(c3.id, target_repo.refs['refs/tags/foo'])
+        self.assertEquals(c3.id, target_repo.refs[b'refs/tags/foo'])
         self.assertTrue(b'f1' not in os.listdir(target_path))
         self.assertTrue(b'f2' not in os.listdir(target_path))