projects
/
cython.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3b447f8
)
__future__ import fix for older Python versions
author
Stefan Behnel
<scoder@users.berlios.de>
Fri, 16 May 2008 06:46:17 +0000
(08:46 +0200)
committer
Stefan Behnel
<scoder@users.berlios.de>
Fri, 16 May 2008 06:46:17 +0000
(08:46 +0200)
Cython/Compiler/Future.py
patch
|
blob
|
history
diff --git
a/Cython/Compiler/Future.py
b/Cython/Compiler/Future.py
index 0028d13c14e4552ae4b90c0182aa2eb4dfe14eaa..854849575bffffbcb37b97ab608e6ae52e5d0189 100644
(file)
--- 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