summaryrefslogtreecommitdiff
path: root/addons/base_import_module
diff options
context:
space:
mode:
authorAdrian Torres <adt@odoo.com>2018-11-08 15:27:30 +0000
committerAdrian Torres <adt@odoo.com>2018-11-29 09:28:17 +0000
commit52f5528cfb6d1152ee226e268247dc685a8ba329 (patch)
treeb44ecfa477b50dd3e488f09f623eecc8bc8e9d7d /addons/base_import_module
parente5c864a596b72515837f0ed1e07550398ecc1ab0 (diff)
[REF] *: replace deprecated pycompat helpers for builtins
This commit replaces calls to pycompat helpers that were intended for python 2 <-> python 3 interoperability for python 3 builtins, as python 2 is no longer officially supported by Odoo. This includes: * calls to imap/izip/ifilter replaced by map/zip/filter * uses of text_type replaced by str * uses of unichr replaced by chr * calls to implements_to_string, implements_iterator removed * string_types and integer_types replaced by str, int respectively * calls to to_native replaced by calls to to_text This is done in preparation to the removal of these deprecated helpers in the following commit.
Diffstat (limited to 'addons/base_import_module')
-rw-r--r--addons/base_import_module/models/ir_module.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/base_import_module/models/ir_module.py b/addons/base_import_module/models/ir_module.py
index 425ad1a01f4..128594cc824 100644
--- a/addons/base_import_module/models/ir_module.py
+++ b/addons/base_import_module/models/ir_module.py
@@ -11,7 +11,7 @@ from os.path import join as opj
from odoo import api, fields, models, _
from odoo.exceptions import UserError
from odoo.modules import load_information_from_description_file
-from odoo.tools import convert_file, exception_to_unicode, pycompat
+from odoo.tools import convert_file, exception_to_unicode
from odoo.tools.osutil import tempdir
_logger = logging.getLogger(__name__)
@@ -88,7 +88,7 @@ class IrModule(models.Model):
with open(full_path, 'rb') as fp:
data = base64.b64encode(fp.read())
url_path = '/{}{}'.format(module, full_path.split(path)[1].replace(os.path.sep, '/'))
- if not isinstance(url_path, pycompat.text_type):
+ if not isinstance(url_path, str):
url_path = url_path.decode(sys.getfilesystemencoding())
filename = os.path.split(url_path)[1]
values = dict(