Skip to content

Commit ee0d6dc

Browse files
author
Sameera
committed
fix for python 3.3 and below
1 parent fbea279 commit ee0d6dc

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/future/builtins/misc.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
- ``open`` (equivalent to io.open on Py2)
1414
- ``super`` (backport of Py3's magic zero-argument super() function
1515
- ``round`` (new "Banker's Rounding" behaviour from Py3)
16-
- ``max`` (new default option from Py3)
17-
- ``min`` (new default option from Py3)
16+
- ``max`` (new default option from Py3.4)
17+
- ``min`` (new default option from Py3.4)
1818
1919
``isinstance`` is also currently exported for backwards compatibility
2020
with v0.8.2, although this has been deprecated since v0.9.
@@ -100,6 +100,11 @@ def pow(x, y, z=_SENTINEL):
100100
__all__ = ['ascii', 'chr', 'hex', 'input', 'isinstance', 'next', 'oct',
101101
'open', 'pow', 'round', 'super', 'max', 'min']
102102

103+
elif not utils.PY34_PLUS:
104+
from future.builtins.new_min_max import newmax as max
105+
from future.builtins.new_min_max import newmin as min
106+
__all__ = ['min', 'max']
107+
103108
else:
104109
import builtins
105110
ascii = builtins.ascii

src/future/utils/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656

5757

5858
PY3 = sys.version_info[0] >= 3
59+
PY34_PLUS = sys.version_info[0:2] >= (3, 4)
5960
PY35_PLUS = sys.version_info[0:2] >= (3, 5)
6061
PY36_PLUS = sys.version_info[0:2] >= (3, 6)
6162
PY2 = sys.version_info[0] == 2

0 commit comments

Comments
 (0)