From b995d5ef8ba9caa5f09bfdaed868f0321547c83d Mon Sep 17 00:00:00 2001 From: Andi Albrecht Date: Sun, 21 Nov 2010 09:08:43 +0100 Subject: Remove next() patch (targets issue12). --- sqlparse/engine/grouping.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'sqlparse') diff --git a/sqlparse/engine/grouping.py b/sqlparse/engine/grouping.py index bfa157b..5fd38ec 100644 --- a/sqlparse/engine/grouping.py +++ b/sqlparse/engine/grouping.py @@ -5,6 +5,11 @@ import itertools from sqlparse import sql from sqlparse import tokens as T +try: + next +except NameError: # Python < 2.6 + next = lambda i: i.next() + def _group_left_right(tlist, ttype, value, cls, check_right=lambda t: True, @@ -132,7 +137,7 @@ def group_identifier(tlist): T.Name, T.Wildcard)))) for t in tl.tokens[i:]: - if x.next()(t): + if next(x)(t): yield t else: raise StopIteration -- cgit v1.2.1