From 8c3e92aa31136fde76edc4a360e0f4ec7026b5d1 Mon Sep 17 00:00:00 2001 From: Laurent Bachelier Date: Wed, 13 Aug 2014 19:48:29 +0200 Subject: [PATCH] fix re flags usage for Python 2.6 fixes #1444 --- weboob/tools/browser2/filters/standard.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/weboob/tools/browser2/filters/standard.py b/weboob/tools/browser2/filters/standard.py index c7c4be6a..9b23d131 100644 --- a/weboob/tools/browser2/filters/standard.py +++ b/weboob/tools/browser2/filters/standard.py @@ -260,9 +260,9 @@ class CleanText(Filter): txt = [t.strip() for t in txt.itertext()] else: txt = [txt.text.strip()] - txt = u' '.join(txt) # 'foo bar' + txt = u' '.join(txt) # 'foo bar' if newlines: - txt = re.sub(u'\s+', u' ', txt, flags=re.UNICODE) # 'foo bar' + txt = re.compile(u'\s+', flags=re.UNICODE).sub(u' ', txt) # 'foo bar' else: # normalize newlines and clean what is inside txt = '\n'.join([cls.clean(l) for l in txt.splitlines()])