From 6b9268bd15f8db22855d91849749b879f2d553a1 Mon Sep 17 00:00:00 2001 From: xmo-odoo Date: Tue, 25 Apr 2017 13:27:54 +0200 Subject: [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 --- odoo/tools/float_utils.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'odoo/tools/float_utils.py') 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') -- cgit v1.2.3