Skip to content

Commit b995d5e

Browse files
committed
Remove next() patch (targets issue12).
1 parent 1789af0 commit b995d5e

2 files changed

Lines changed: 6 additions & 12 deletions

File tree

extras/py3k/fixes.diff

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,3 @@
1-
--- sqlparse/engine/grouping.py.orig 2009-04-30 06:48:43.000000000 +0200
2-
+++ sqlparse/engine/grouping.py 2009-04-30 06:48:56.000000000 +0200
3-
@@ -107,7 +107,7 @@
4-
T.Name,
5-
T.Wildcard)))
6-
for t in tl.tokens[i:]:
7-
- if x.next()(t):
8-
+ if next(x)(t):
9-
yield t
10-
else:
11-
raise StopIteration
121
--- sqlparse/sql.py~ 2009-04-30 08:38:16.000000000 +0200
132
+++ sqlparse/sql.py 2009-04-30 08:39:15.000000000 +0200
143
@@ -23,16 +23,13 @@

sqlparse/engine/grouping.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55
from sqlparse import sql
66
from sqlparse import tokens as T
77

8+
try:
9+
next
10+
except NameError: # Python < 2.6
11+
next = lambda i: i.next()
12+
813

914
def _group_left_right(tlist, ttype, value, cls,
1015
check_right=lambda t: True,
@@ -132,7 +137,7 @@ def _consume_cycle(tl, i):
132137
T.Name,
133138
T.Wildcard))))
134139
for t in tl.tokens[i:]:
135-
if x.next()(t):
140+
if next(x)(t):
136141
yield t
137142
else:
138143
raise StopIteration

0 commit comments

Comments
 (0)