Commit 4c663520 authored by Nikolay Kim's avatar Nikolay Kim

It's not possible to use xrange inside __getslice__ in 64bit python on

Windows, because xrange uses 32bit integers and __getslice__ gets 64bit integers
parent a8ed7dce
...@@ -13,6 +13,9 @@ Bugs Fixed ...@@ -13,6 +13,9 @@ Bugs Fixed
- Fixed two unit tests that failed on fast Windows machines. - Fixed two unit tests that failed on fast Windows machines.
- Fixed OverflowError in Products.ZCatalog.Lazy on 64bit python
on Windows.
- Fixed ``testZODBCompat`` tests in ZopeTestCase to match modern ZODB - Fixed ``testZODBCompat`` tests in ZopeTestCase to match modern ZODB
semantics. semantics.
......
...@@ -11,6 +11,9 @@ ...@@ -11,6 +11,9 @@
# #
############################################################################## ##############################################################################
from itertools import islice, count
class Lazy(object): class Lazy(object):
# Allow (reluctantly) access to unprotected attributes # Allow (reluctantly) access to unprotected attributes
...@@ -43,7 +46,7 @@ class Lazy(object): ...@@ -43,7 +46,7 @@ class Lazy(object):
def __getslice__(self, i1, i2): def __getslice__(self, i1, i2):
r = [] r = []
for i in xrange(i1, i2): for i in islice(count(i1), i2-i1):
try: try:
r.append(self[i]) r.append(self[i])
except IndexError: except IndexError:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment