summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndi Albrecht <albrecht.andi@gmail.com>2010-11-21 09:08:43 +0100
committerAndi Albrecht <albrecht.andi@gmail.com>2010-11-21 09:08:43 +0100
commitb995d5ef8ba9caa5f09bfdaed868f0321547c83d (patch)
tree5953d338971d659d5da02ddedef0111d894a98fb
parent1789af06e4cced90401ec7dda35c62045fb05667 (diff)
downloadsqlparse-b995d5ef8ba9caa5f09bfdaed868f0321547c83d.tar.gz
Remove next() patch (targets issue12).
-rw-r--r--extras/py3k/fixes.diff11
-rw-r--r--sqlparse/engine/grouping.py7
2 files changed, 6 insertions, 12 deletions
diff --git a/extras/py3k/fixes.diff b/extras/py3k/fixes.diff
index 3fdefa3..10c4f57 100644
--- a/extras/py3k/fixes.diff
+++ b/extras/py3k/fixes.diff
@@ -1,14 +1,3 @@
---- sqlparse/engine/grouping.py.orig 2009-04-30 06:48:43.000000000 +0200
-+++ sqlparse/engine/grouping.py 2009-04-30 06:48:56.000000000 +0200
-@@ -107,7 +107,7 @@
- T.Name,
- T.Wildcard)))
- for t in tl.tokens[i:]:
-- if x.next()(t):
-+ if next(x)(t):
- yield t
- else:
- raise StopIteration
--- sqlparse/sql.py~ 2009-04-30 08:38:16.000000000 +0200
+++ sqlparse/sql.py 2009-04-30 08:39:15.000000000 +0200
@@ -23,16 +23,13 @@
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