summaryrefslogtreecommitdiff
path: root/repoze
diff options
context:
space:
mode:
authorJoel Bohman <joelboh@gmail.com>2011-08-16 16:06:01 +0200
committerJoel Bohman <joelboh@gmail.com>2011-08-16 16:06:01 +0200
commit03840599e51466b6dcd94d37533414bc41a5a1dc (patch)
tree0acad945799b1f226b40d623fcc66b015f3a51ad /repoze
parenta645b45f3839a325d14206d7048f66db747b5975 (diff)
downloadrepoze-lru-03840599e51466b6dcd94d37533414bc41a5a1dc.tar.gz
Added Python 3 support.
Diffstat (limited to 'repoze')
-rw-r--r--repoze/lru/__init__.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/repoze/lru/__init__.py b/repoze/lru/__init__.py
index 0af65e8..0c57a0e 100644
--- a/repoze/lru/__init__.py
+++ b/repoze/lru/__init__.py
@@ -1,6 +1,10 @@
""" LRU caching class and decorator """
import threading
+try:
+ range = xrange
+except NameError:
+ pass
_marker = object()
@@ -18,7 +22,7 @@ class LRUCache(object):
try:
size = self.size
self.clock = []
- for i in xrange(0, size):
+ for i in range(0, size):
self.clock.append({'key':_marker, 'ref':False})
self.maxpos = size - 1
self.hand = 0