Commits

Mike Bayer committed 3265457

merge next() compatibility

  • Participants
  • Parent commits 3b95ea3
  • Branches rel_0_7

Comments (0)

Files changed (3)

File lib/sqlalchemy/sql/compiler.py

         poscount = itertools.count(1)
         self.string = re.sub(
                         r'\[_POSITION\]', 
-                        lambda m:str(next(poscount)), 
+                        lambda m:str(util.next(poscount)), 
                         self.string)
 
     @util.memoized_property

File lib/sqlalchemy/util/__init__.py

 from compat import callable, cmp, reduce, defaultdict, py25_dict, \
     threading, py3k_warning, jython, pypy, win32, set_types, buffer, pickle, \
     update_wrapper, partial, md5_hex, decode_slice, dottedgetter,\
-    parse_qsl, any, contextmanager
+    parse_qsl, any, contextmanager, next
 
 from _collections import NamedTuple, ImmutableContainer, immutabledict, \
     Properties, OrderedProperties, ImmutableProperties, OrderedDict, \

File lib/sqlalchemy/util/compat.py

 
     set_types = set, sets.Set
 
+if sys.version_info < (2, 6):
+    def next(iter):
+        return iter.next()
+else:
+    next = next
 if py3k_warning:
     import pickle
 else: