Handle revisions without text
This commit is contained in:
parent
1db581725b
commit
7cf5b013da
1 changed files with 3 additions and 6 deletions
|
|
@ -20,12 +20,9 @@ def process_page(page):
|
|||
info["redirect"] = page.redirect
|
||||
else:
|
||||
[revision] = list(page) # Every page has exactly one revision
|
||||
if revision.text is not None:
|
||||
info["length"] = len(revision.text)
|
||||
|
||||
length = len(revision.text)
|
||||
info["length"] = length
|
||||
|
||||
# Parsing may fail for articles with length 0
|
||||
if length > 0:
|
||||
links = []
|
||||
for link in wtp.parse(revision.text).wikilinks:
|
||||
start, end = link.span
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue