Skip to content
Myr

Merge pull request #3082 from cclauss/patch-2

Before adoption: this commit came in with the history the project adopted, so no landing records it.

_compat.py: Use feature detection instead of version detection

authored by David Lord · committed by GitHub · parents 74691fb, 47bdf9f · Browse files · 1 file+6 added−6 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+6 added−6 removed

  • other:+6 added−6 removed

1 file+6 added−6 removed

modified:flask/_compat.py+6 added-6 removed
14 unmodified lines
1516PY2 = sys.version_info[0] == 217_identity = lambda x: x181920if not PY2:19try: # Python 220 text_type = unicode21 string_types = (str, unicode)22 integer_types = (int, long)23except NameError: # Python 324 text_type = str25 string_types = (str,)26 integer_types = (int,)2728if not PY2:29 iterkeys = lambda d: iter(d.keys())30 itervalues = lambda d: iter(d.values())31 iteritems = lambda d: iter(d.items())32
8 unmodified lines
4142 implements_to_string = _identity4344else:41 text_type = unicode42 string_types = (str, unicode)43 integer_types = (int, long)4445 iterkeys = lambda d: d.iterkeys()46 itervalues = lambda d: d.itervalues()47 iteritems = lambda d: d.iteritems()48
62 unmodified lines