diff options
author | Bob Ippolito <bob@redivi.com> | 2009-05-17 18:44:40 +0000 |
---|---|---|
committer | Bob Ippolito <bob@redivi.com> | 2009-05-17 18:44:40 +0000 |
commit | 7f6c62499a21139ff486f44787f6850ac6ce6f02 (patch) | |
tree | 7f19242aa57b9c1509c4988629174ee75ce864d2 | |
parent | e80ea4a9dcd022ef6d43879ed295230e268967f6 (diff) | |
download | simplejson-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.py | 7 |
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 |