Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion gin
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import collections
import json
import mmap
import struct
import sys

def check(boolean, message):
if not boolean:
Expand All @@ -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."
Expand Down