Permalink
Browse files

minor code simplification

  • Loading branch information...
1 parent 6c5accd commit b17c222f3fe8be6549c7b2d6b2e7bf4a594f0b6b @scoder scoder committed Aug 11, 2012
Showing with 2 additions and 5 deletions.
  1. +2 −5 Cython/Compiler/Future.py
@@ -1,10 +1,7 @@
def _get_feature(name):
import __future__
- try:
- return getattr(__future__, name)
- except AttributeError:
- # unique fake object for earlier Python versions or Python 3
- return object()
+ # fall back to a unique fake object for earlier Python versions or Python 3
+ return getattr(__future__, name, object())
unicode_literals = _get_feature("unicode_literals")
with_statement = _get_feature("with_statement")

0 comments on commit b17c222

Please sign in to comment.