From 666b5835295cc4742bd27438d7fc87e635903d3e Mon Sep 17 00:00:00 2001 From: Leonhard Masche Date: Tue, 30 May 2023 18:39:57 +0200 Subject: [PATCH] Make MMap win32 compatible Use the system-agnostic `access` argument instead of the posix specific `prot` when initializing mmap. --- probables/utilities.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/probables/utilities.py b/probables/utilities.py index e5efe5f..9d41629 100644 --- a/probables/utilities.py +++ b/probables/utilities.py @@ -42,7 +42,7 @@ class MMap: def __init__(self, path: Union[Path, str]): self.__p = Path(path) self.__f = self.path.open("rb") - self.__m = mmap.mmap(self.__f.fileno(), 0, prot=mmap.PROT_READ) + self.__m = mmap.mmap(self.__f.fileno(), 0, access=mmap.ACCESS_READ) self._closed = False def __enter__(self) -> mmap.mmap: