summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Ippolito <bob@redivi.com>2009-05-17 18:44:40 +0000
committerBob Ippolito <bob@redivi.com>2009-05-17 18:44:40 +0000
commit7f6c62499a21139ff486f44787f6850ac6ce6f02 (patch)
tree7f19242aa57b9c1509c4988629174ee75ce864d2
parente80ea4a9dcd022ef6d43879ed295230e268967f6 (diff)
downloadsimplejson-7f6c62499a21139ff486f44787f6850ac6ce6f02.tar.gz
apply suggested fix for Python 2.4 compatibility http://code.google.com/p/simplejson/issues/detail?id=53
git-svn-id: http://simplejson.googlecode.com/svn/trunk@186 a4795897-2c25-0410-b006-0d3caba88fa1
-rw-r--r--simplejson/ordered_dict.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/simplejson/ordered_dict.py b/simplejson/ordered_dict.py
index d5a55eb..fb6188f 100644
--- a/simplejson/ordered_dict.py
+++ b/simplejson/ordered_dict.py
@@ -52,7 +52,12 @@ class OrderedDict(dict, DictMixin):
def popitem(self, last=True):
if not self:
raise KeyError('dictionary is empty')
- key = reversed(self).next() if last else iter(self).next()
+ # Modified from original to support Python 2.4, see
+ # http://code.google.com/p/simplejson/issues/detail?id=53
+ if last:
+ key = reversed(self).next()
+ else:
+ key = iter(self).next()
value = self.pop(key)
return key, value