From a56a8dacf3b0bc54f6133a2037c2c452152c1653 Mon Sep 17 00:00:00 2001 From: Malcolm Tredinnick Date: Sun, 24 Jun 2007 12:38:11 +0000 Subject: [PATCH] Fixed small bug in Python 2.3 fallback for itertools.groupby. Refs #4506. git-svn-id: http://code.djangoproject.com/svn/django/trunk@5526 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/utils/itercompat.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django/utils/itercompat.py b/django/utils/itercompat.py index ff814bfd7b..0de1b6cbe2 100644 --- a/django/utils/itercompat.py +++ b/django/utils/itercompat.py @@ -34,7 +34,7 @@ def groupby(iterable, keyfunc=None): keyfunc = lambda x:x iterable = iter(iterable) l = [iterable.next()] - lastkey = keyfunc(l) + lastkey = keyfunc(l[0]) for item in iterable: key = keyfunc(item) if key != lastkey: