From 1214085f67457865aff4307b847ee4264fec2bd1 Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Mon, 6 Jun 2016 11:37:49 -0700 Subject: fix pathod test on Windows --- pathod/language/generators.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pathod/language/generators.py b/pathod/language/generators.py index 9fff3082..68705941 100644 --- a/pathod/language/generators.py +++ b/pathod/language/generators.py @@ -3,6 +3,7 @@ import random import mmap import six +import sys DATATYPES = dict( ascii_letters=string.ascii_letters.encode(), @@ -68,7 +69,7 @@ class RandomGenerator(object): def __getitem__(self, x): chars = DATATYPES[self.dtype] if isinstance(x, slice): - return b"".join(rand_byte(chars) for _ in range(*x.indices(self.length))) + return b"".join(rand_byte(chars) for _ in range(*x.indices(min(self.length, sys.maxsize)))) return rand_byte(chars) def __repr__(self): -- cgit v1.2.3