summaryrefslogtreecommitdiff
path: root/odoo/tools/float_utils.py
diff options
context:
space:
mode:
authorxmo-odoo <xmo@odoo.com>2017-04-25 13:27:54 +0200
committerGitHub <noreply@github.com>2017-04-25 13:27:54 +0200
commit6b9268bd15f8db22855d91849749b879f2d553a1 (patch)
treea14ed2a0ff1b4eafb0f94b0dfafcea34187499bf /odoo/tools/float_utils.py
parent3cbca4b7348b60eb6cfe3f423983d53dada67862 (diff)
[FIX] print statement -> function
In Python 3, ``print`` becomes a builtin function. This is available in Python 2 by importing the ``print_function`` feature from ``__future__``, the feature is conveniently still available in Python 3 (it just does nothing). Fixers: libfuturize.fixes.fix_print_with_import #8530
Diffstat (limited to 'odoo/tools/float_utils.py')
-rw-r--r--odoo/tools/float_utils.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/odoo/tools/float_utils.py b/odoo/tools/float_utils.py
index 127c546125f..959299e2c97 100644
--- a/odoo/tools/float_utils.py
+++ b/odoo/tools/float_utils.py
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
+from __future__ import print_function
import math
def _float_check_precision(precision_digits=None, precision_rounding=None):
@@ -207,7 +208,7 @@ if __name__ == "__main__":
precision_digits=precision_digits)
if result != expected:
errors += 1
- print '###!!! Rounding error: got %s , expected %s' % (result, expected)
+ print('###!!! Rounding error: got %s , expected %s' % (result, expected))
# Extended float range test, inspired by Cloves Almeida's test on bug #882036.
fractions = [.0, .015, .01499, .675, .67499, .4555, .4555, .45555]
@@ -229,4 +230,4 @@ if __name__ == "__main__":
# 47130 round calls in 0.422306060791 secs, with Python 2.6.7 on Core i3 x64
# with decimal:
# 47130 round calls in 6.612248100021 secs, with Python 2.6.7 on Core i3 x64
- print count, " round calls, ", errors, "errors, done in ", (stop-start), 'secs'
+ print(count, " round calls, ", errors, "errors, done in ", (stop-start), 'secs')