diff options
| author | Martin Trigaux <mat@odoo.com> | 2020-01-30 15:03:16 +0000 |
|---|---|---|
| committer | Martin Trigaux <mat@odoo.com> | 2020-02-03 14:38:20 +0000 |
| commit | eafa9f4abc751b07f2ecb67dbe029687278d1d52 (patch) | |
| tree | a44840b102a5b791af64e1da0430c1f71e8e57b6 /odoo/addons/test_limits | |
| parent | 5a6165da847ca131d32135771100c1945d764ad4 (diff) | |
[FIX] *: python 3.8 compatibility
time.clock is deprecated since python 3.3 and no longer exists in python 3.8
time.process_time was introduced in python 3.3
Replace "is" by "==" as this produces a SyntaxWarning in python 3.8
Fixes odoo/odoo#41313
closes odoo/odoo#44502
X-original-commit: f03b4cb5576f264b6845242ba112f02422af4f5f
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Diffstat (limited to 'odoo/addons/test_limits')
| -rw-r--r-- | odoo/addons/test_limits/models.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/odoo/addons/test_limits/models.py b/odoo/addons/test_limits/models.py index c443c9ed1c9..fe659c863fb 100644 --- a/odoo/addons/test_limits/models.py +++ b/odoo/addons/test_limits/models.py @@ -36,10 +36,10 @@ class m(models.Model): @api.model def consume_cpu_time(self, seconds): - t0 = time.clock() - t1 = time.clock() + t0 = time.process_time() + t1 = time.process_time() while t1 - t0 < seconds: for i in range(10000000): x = i * i - t1 = time.clock() + t1 = time.process_time() return True |
