keep portability fix in generators.pyx to keep it working with older Python versions
authorStefan Behnel <scoder@users.berlios.de>
Tue, 19 Apr 2011 07:11:49 +0000 (09:11 +0200)
committerStefan Behnel <scoder@users.berlios.de>
Tue, 19 Apr 2011 07:11:49 +0000 (09:11 +0200)
tests/run/generators.pyx

index 97cc72b98ee35e4a25955644d5a996810454710a..a501c7619bc2038a9bb465e8aa50f4817d72c491 100644 (file)
@@ -7,6 +7,10 @@ except ImportError:
     def next(it):
         return it.next()
 
+if hasattr(__builtins__, 'GeneratorExit'):
+    GeneratorExit = __builtins__.GeneratorExit
+else: # < 2.5
+    GeneratorExit = StopIteration
 
 def very_simple():
     """