Commit 1f45b39f authored by Rémi Cardona's avatar Rémi Cardona
Browse files

[py3k] Import unquote from six.moves

Related to #268148.
parent 45e2f83f4daa
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
# You should have received a copy of the GNU Lesser General Public License along # You should have received a copy of the GNU Lesser General Public License along
# with logilab-mtconverter. If not, see <http://www.gnu.org/licenses/>. # with logilab-mtconverter. If not, see <http://www.gnu.org/licenses/>.
from logilab.common.testlib import TestCase, unittest_main from logilab.common.testlib import TestCase, unittest_main
import urllib from six.moves.urllib.parse import unquote as url_unquote
import re import re
import os.path as osp import os.path as osp
...@@ -33,7 +33,7 @@ class HtmlToText(Transform): ...@@ -33,7 +33,7 @@ class HtmlToText(Transform):
def __call__(self, orig): def __call__(self, orig):
orig = re.sub('<[^>]*>(?i)(?m)', '', orig) orig = re.sub('<[^>]*>(?i)(?m)', '', orig)
return urllib.unquote(re.sub('\n+', '\n', orig)).strip() return url_unquote(re.sub('\n+', '\n', orig)).strip()
def _convert(self, data): def _convert(self, data):
return self.__call__(data.data) return self.__call__(data.data)
...@@ -47,7 +47,7 @@ class FooToBar(Transform): ...@@ -47,7 +47,7 @@ class FooToBar(Transform):
def __call__(self, orig): def __call__(self, orig):
orig = re.sub('foo', 'bar', orig) orig = re.sub('foo', 'bar', orig)
return urllib.unquote(re.sub('\n+', '\n', orig)).strip() return url_unquote(re.sub('\n+', '\n', orig)).strip()
def _convert(self, data): def _convert(self, data):
return self.__call__(data.data) return self.__call__(data.data)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment