Skip to content

Commit 2ee2fe9

Browse files
committed
Throw some checking aroud the build_doc
1 parent ac5ef73 commit 2ee2fe9

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/readability_lxml/encoding.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77

88

99
def get_encoding(page):
10-
LOG.info('GET ENCODING')
11-
LOG.info(type(page))
1210
text = re.sub('</?[^>]*>\s*', ' ', page)
1311
enc = 'utf-8'
1412
if not text.strip() or len(text) < 10:

src/readability_lxml/htmls.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@
1717

1818

1919
def build_doc(page):
20-
LOG.info('BUILD DOC')
21-
LOG.info(type(page))
20+
"""Requires that the `page` not be None"""
21+
if page is None:
22+
LOG.error("Page content is None, can't build_doc")
23+
return ''
2224
if isinstance(page, unicode):
2325
page_unicode = page
2426
else:

0 commit comments

Comments
 (0)