Commit b17c222f authored by Stefan Behnel's avatar Stefan Behnel

minor code simplification

parent 6c5accdd
def _get_feature(name): def _get_feature(name):
import __future__ import __future__
try: # fall back to a unique fake object for earlier Python versions or Python 3
return getattr(__future__, name) return getattr(__future__, name, object())
except AttributeError:
# unique fake object for earlier Python versions or Python 3
return object()
unicode_literals = _get_feature("unicode_literals") unicode_literals = _get_feature("unicode_literals")
with_statement = _get_feature("with_statement") with_statement = _get_feature("with_statement")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment