From 26986faad381f72078921d15f777024ff88fd15c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Legan=C3=A9s=20Combarro=20=22Piranna=22?= Date: Sat, 19 May 2012 23:52:53 +0200 Subject: Fixed bug on __getitem__ (infinite loop because pop() use it already) --- sqlparse/utils.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sqlparse/utils.py b/sqlparse/utils.py index 016a292..cdf27b1 100644 --- a/sqlparse/utils.py +++ b/sqlparse/utils.py @@ -20,8 +20,9 @@ if OrderedDict: self._maxsize = maxsize def __getitem__(self, key, *args, **kwargs): - # Remove the (key, value) pair from the cache, or raise KeyError - value = self.pop(key) + # Get the key and remove it from the cache, or raise KeyError + value = OrderedDict.__getitem__(self, key) + del self[key] # Insert the (key, value) pair on the front of the cache OrderedDict.__setitem__(self, key, value) -- cgit v1.2.1