diff options
| author | xmo-odoo <xmo@odoo.com> | 2017-04-28 09:06:53 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-04-28 09:06:53 +0200 |
| commit | b4429c2a91889bf60b56e0c7909c844d357363f7 (patch) | |
| tree | 1ae879a60a34454b4a93425f0ebe7d5ccd029c03 /odoo/fields.py | |
| parent | c5579ef89e2a595893d0959bef6fddfdbfb6d697 (diff) | |
[FIX] Various P3-related import changes
* LDAP import: python-ldap is not python3-compatible, pyldap is
Warning: only supported from debian Stretch (current testing)?
https://packages.debian.org/search?searchon=names&keywords=pyldap
* implicitly relative imports
* imports of moved or removed stdlib modules
issue #8530
Diffstat (limited to 'odoo/fields.py')
| -rw-r--r-- | odoo/fields.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/odoo/fields.py b/odoo/fields.py index d713167a101..9a440651268 100644 --- a/odoo/fields.py +++ b/odoo/fields.py @@ -10,7 +10,11 @@ from operator import attrgetter from types import NoneType import logging import pytz -import xmlrpclib +try: + from xmlrpc.client import MAXINT +except ImportError: + #pylint: disable=bad-python3-import + from xmlrpclib import MAXINT import psycopg2 @@ -1168,7 +1172,7 @@ class Integer(Field): def convert_to_read(self, value, record, use_name_get=True): # Integer values greater than 2^31-1 are not supported in pure XMLRPC, # so we have to pass them as floats :-( - if value and value > xmlrpclib.MAXINT: + if value and value > MAXINT: return float(value) return value |
