summaryrefslogtreecommitdiff
path: root/addons/transifex
diff options
context:
space:
mode:
authorXavier Morel <xmo@odoo.com>2020-01-29 09:12:11 +0000
committerXavier Morel <xmo@odoo.com>2020-02-04 12:42:35 +0000
commitde590816d8d06730d99499db9a068f8d0e2cd3f9 (patch)
treea138df14693c2f76614e76cd26a8fcf34d0df631 /addons/transifex
parenteae19fc2cd3496d4b59e4d8029fcceb5eaa3a561 (diff)
[FIX] *: deprecated access to url_ utilities through werkzeug root
In 0.15 accessing werkzeug.urls functions directly through werkzeug is deprecated, the shortcut will be removed in the eventual werkzeug 1.0. Fix existing uses of these shortcuts. Also cleanup some imports when they're not far from a werkzeug* import being altered.
Diffstat (limited to 'addons/transifex')
-rw-r--r--addons/transifex/models/ir_translation.py10
1 files changed, 3 insertions, 7 deletions
diff --git a/addons/transifex/models/ir_translation.py b/addons/transifex/models/ir_translation.py
index ed1150f8d14..1f17fc47d3a 100644
--- a/addons/transifex/models/ir_translation.py
+++ b/addons/transifex/models/ir_translation.py
@@ -1,14 +1,10 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
-try:
- from configparser import ConfigParser
-except ImportError:
- # python2 import
- from ConfigParser import ConfigParser
+from configparser import ConfigParser
from os.path import join as opj
import os
-import werkzeug
+import werkzeug.urls
import odoo
from odoo import models, fields
@@ -84,7 +80,7 @@ class IrTranslation(models.Model):
'project': project,
'lang': lang_code,
'module': translation.module,
- 'src': "text:'" + werkzeug.url_quote_plus(
+ 'src': "text:'" + werkzeug.urls.url_quote_plus(
translation.src[:50].replace("\n", "").replace("'", "")
) + "'",
}