[svn] fixed bug in CacheDict for python2.4
authorArmin Ronacher <armin.ronacher@active-4.com>
Sun, 1 Apr 2007 12:35:21 +0000 (14:35 +0200)
committerArmin Ronacher <armin.ronacher@active-4.com>
Sun, 1 Apr 2007 12:35:21 +0000 (14:35 +0200)
--HG--
branch : trunk

jinja/utils.py

index dec5348d3ff09155a07ea21dcc60c54c51346383..2b0a4cfebf0b498b277d4d1a114de22d8ca5be49 100644 (file)
@@ -21,9 +21,9 @@ from jinja.nodes import Trans
 from jinja.datastructure import Context, TemplateData
 from jinja.exceptions import SecurityException, TemplateNotFound
 
-try:
+if sys.version_info >= (2, 5):
     from collections import deque
-except ImportError:
+else:
     deque = None
 
 #: number of maximal range items
@@ -416,7 +416,7 @@ class CacheDict(object):
         if deque is not None:
             self._queue = deque()
             self._popleft = self._queue.popleft
-        # python2.3, just use a list
+        # python2.3/2.4, just use a list
         else:
             self._queue = []
             pop = self._queue.pop