ソースを参照

Explicitly disable mmap on plan9 where it doesn't work.

Patch from Jeff Sickel.
Jelmer Vernooij 10 年 前
コミット
23eaa9164c
2 ファイル変更10 行追加1 行削除
  1. 3 0
      NEWS
  2. 7 1
      dulwich/pack.py

+ 3 - 0
NEWS

@@ -23,6 +23,9 @@
   * Fix handling of tags of non-commits in missing object finder.
     (Augie Fackler, #211)
 
+  * Explicitly disable mmap on plan9 where it doesn't work.
+    (Jeff Sickel)
+
  IMPROVEMENTS
 
   * New public method `Repo.reset_index`. (Jelmer Vernooij)

+ 7 - 1
dulwich/pack.py

@@ -47,14 +47,20 @@ except ImportError:
     imap = map
     izip = zip
 
+import os
+
 try:
     import mmap
 except ImportError:
     has_mmap = False
 else:
     has_mmap = True
+
+# For some reason the above try, except fails to set has_mmap = False
+if os.uname()[0] == 'Plan9':
+    has_mmap = False
+
 from hashlib import sha1
-import os
 from os import (
     SEEK_CUR,
     SEEK_END,