Browse Source

Fix when we've cached None as a url.

tags/v0.2
Ben Kurtovic 12 years ago
parent
commit
4ff7612a27
1 changed files with 6 additions and 1 deletions
  1. +6
    -1
      earwigbot/wiki/copyvios/__init__.py

+ 6
- 1
earwigbot/wiki/copyvios/__init__.py View File

@@ -230,8 +230,13 @@ class CopyvioMixIn(object):
content = self.get()
clean = ArticleTextParser(content).strip()
article_chain = MarkovChain(clean)
confidence, chains = self._copyvio_compare_content(article_chain, url)

if not url:
empty = MarkovChain("")
chns = (empty, MarkovChainIntersection(empty, empty))
return CopyvioCheckResult(False, 0, url, 0, 0, article_chain, chns)

confidence, chains = self._copyvio_compare_content(article_chain, url)
ctime = time() - start_time
if confidence >= min_confidence:
is_violation = True


Loading…
Cancel
Save