From 452bd52fc25354f94f3e13f6aa13605d8d864d2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Nyffenegger?= Date: Tue, 8 Feb 2022 11:43:10 +0100 Subject: [PATCH] Use Windows specific mmap constructor --- gin | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gin b/gin index e506a99..4b3fbbd 100755 --- a/gin +++ b/gin @@ -9,6 +9,7 @@ import collections import json import mmap import struct +import sys def check(boolean, message): if not boolean: @@ -18,7 +19,7 @@ def check(boolean, message): def parse(filename, pretty=True): with open(filename, "rb") as o: - f = mmap.mmap(o.fileno(), 0, prot=mmap.PROT_READ) + f = mmap.mmap(o.fileno(), 0, access=mmap.ACCESS_READ) if sys.platform == 'win32' else mmap.mmap(o.fileno(), 0, prot=mmap.PROT_READ) def read(format): # "All binary numbers are in network byte order."