We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8209539 commit 03770dbCopy full SHA for 03770db
src/libfuturize/fixes/fix_division_safe.py
@@ -31,7 +31,7 @@ def match_division(node):
31
return node.type == slash and not node.next_sibling.type == slash and \
32
not node.prev_sibling.type == slash
33
34
-const_re = re.compile('^[0-9.]+$')
+const_re = re.compile('^[0-9]*[.][0-9]*$')
35
36
37
def _is_floaty(expr):
tests/test_future/test_futurize.py
@@ -1179,7 +1179,7 @@ def test_safe_division(self):
1179
from __future__ import division
1180
from past.utils import old_div
1181
x = old_div(3, 2)
1182
- y = old_div(3., 2)
+ y = 3. / 2
1183
assert x == 1 and isinstance(x, int)
1184
assert y == 1.5 and isinstance(y, float)
1185
"""
0 commit comments