diff options
author | Joel Bohman <joelboh@gmail.com> | 2011-08-16 16:06:01 +0200 |
---|---|---|
committer | Joel Bohman <joelboh@gmail.com> | 2011-08-16 16:06:01 +0200 |
commit | 03840599e51466b6dcd94d37533414bc41a5a1dc (patch) | |
tree | 0acad945799b1f226b40d623fcc66b015f3a51ad /repoze | |
parent | a645b45f3839a325d14206d7048f66db747b5975 (diff) | |
download | repoze-lru-03840599e51466b6dcd94d37533414bc41a5a1dc.tar.gz |
Added Python 3 support.
Diffstat (limited to 'repoze')
-rw-r--r-- | repoze/lru/__init__.py | 6 |
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 |