diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2018-03-18 21:39:13 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-18 21:39:13 +0100 |
commit | 9f12b26b81a8e7667b2a26a7878e5bc033610ed5 (patch) | |
tree | 43cc6d8a89daaea7e0546a06e5f068ba246e53da | |
parent | 190c04569bd2a29597065222cdcc322ec4f2b374 (diff) | |
parent | 693b17122a6ee70b37cbac8603448aa4f139f282 (diff) | |
download | gitpython-9f12b26b81a8e7667b2a26a7878e5bc033610ed5.tar.gz |
Merge pull request #736 from hugovk/fix-version-check
Allow mmap not just for py2.6, 2.7 and 3.6+ but also 3.0+
-rw-r--r-- | git/index/base.py | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/git/index/base.py b/git/index/base.py index a9e3a3c7..e6682d5d 100644 --- a/git/index/base.py +++ b/git/index/base.py @@ -8,7 +8,6 @@ from io import BytesIO import os from stat import S_ISLNK import subprocess -import sys import tempfile from git.compat import ( @@ -18,7 +17,6 @@ from git.compat import ( force_bytes, defenc, mviter, - is_win ) from git.exc import ( GitCommandError, @@ -128,13 +126,7 @@ class IndexFile(LazyMixin, diff.Diffable, Serializable): lfd.rollback() # END exception handling - # Here it comes: on windows in python 2.5, memory maps aren't closed properly - # Hence we are in trouble if we try to delete a file that is memory mapped, - # which happens during read-tree. - # In this case, we will just read the memory in directly. - # Its insanely bad ... I am disappointed ! - allow_mmap = (is_win or sys.version_info[1] > 5) - stream = file_contents_ro(fd, stream=True, allow_mmap=allow_mmap) + stream = file_contents_ro(fd, stream=True, allow_mmap=True) try: self._deserialize(stream) |