From 39ddb303f23c9fa6d0cead8cf4ecd420bb024297 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Fri, 16 May 2008 08:46:17 +0200 Subject: [PATCH] __future__ import fix for older Python versions --- Cython/Compiler/Future.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Cython/Compiler/Future.py b/Cython/Compiler/Future.py index 0028d13c..85484957 100644 --- a/Cython/Compiler/Future.py +++ b/Cython/Compiler/Future.py @@ -1,5 +1,11 @@ -import __future__ +def _get_feature(name): + import __future__ + try: + return getattr(__future__, name) + except AttributeError: + # unique fake object for earlier Python versions + return object() -unicode_literals = __future__.unicode_literals +unicode_literals = _get_feature("unicode_literals") -del __future__ +del _get_feature -- 2.26.2