From 5d30ad61f0516a1bf98eeee983bc0250bd8cabf0 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Tue, 19 Apr 2011 09:11:49 +0200 Subject: [PATCH] keep portability fix in generators.pyx to keep it working with older Python versions --- tests/run/generators.pyx | 4 ++++ 1 file changed, 4 insertions(+) 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(): """ -- 2.26.2