From: Stefan Behnel Date: Tue, 19 Apr 2011 07:11:49 +0000 (+0200) Subject: keep portability fix in generators.pyx to keep it working with older Python versions X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=5d30ad61f0516a1bf98eeee983bc0250bd8cabf0;p=cython.git keep portability fix in generators.pyx to keep it working with older Python versions --- diff --git a/tests/run/generators.pyx b/tests/run/generators.pyx index 97cc72b9..a501c761 100644 --- a/tests/run/generators.pyx +++ b/tests/run/generators.pyx @@ -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(): """