Pārlūkot izejas kodu

Fix fastimport support on python3.4.

Jelmer Vernooij 9 gadi atpakaļ
vecāks
revīzija
18884ba065
2 mainītis faili ar 3 papildinājumiem un 3 dzēšanām
  1. 1 1
      .travis.yml
  2. 2 2
      dulwich/fastexport.py

+ 1 - 1
.travis.yml

@@ -9,7 +9,7 @@ matrix:
     - python: "pypy"
       env: TEST_REQUIRE="fastimport"
     - python: "3.4"
-      env: TEST_REQUIRE=
+      env: TEST_REQUIRE="fastimport"
     - python: "3.5"
       env: TEST_REQUIRE="fastimport"
 cache:

+ 2 - 2
dulwich/fastexport.py

@@ -62,7 +62,7 @@ class GitFastExporter(object):
 
     def _allocate_marker(self):
         self._marker_idx+=1
-        return b"%d" % (self._marker_idx,)
+        return ("%d" % (self._marker_idx,)).encode('ascii')
 
     def _export_blob(self, blob):
         marker = self._allocate_marker()
@@ -87,7 +87,7 @@ class GitFastExporter(object):
             if old_path != new_path and old_path is not None:
                 yield commands.FileRenameCommand(old_path, new_path)
             if old_mode != new_mode or old_hexsha != new_hexsha:
-                prefixed_marker = b':%s' %  (marker,)
+                prefixed_marker = b':' + marker
                 yield commands.FileModifyCommand(
                     new_path, new_mode, prefixed_marker, None
                 )