From 9f175994c6865f35413dce9b22151b4cfdea684f Mon Sep 17 00:00:00 2001 From: pictuga Date: Tue, 30 Apr 2013 19:51:29 +0200 Subject: [PATCH] Fix regex implementation. --- morss.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/morss.py b/morss.py index d6fe98c..bda9945 100644 --- a/morss.py +++ b/morss.py @@ -261,10 +261,10 @@ def EncDownload(url): log('header') enc = con.headers.getparam('charset') else: - match = re.search('charset=["\']?([0-9a-zA-Z-]+)', data).groups() - if len(match): + match = re.search('charset=["\']?([0-9a-zA-Z-]+)', data) + if match: log('meta.re') - enc = match[0] + enc = match.groups()[0] else: log('chardet') enc = chardet.detect(data)['encoding']