jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/606944 )
Change subject: [IMPR] decrease nested flow in interwiki page_empty_check function ......................................................................
[IMPR] decrease nested flow in interwiki page_empty_check function
Also do not raise IsRedirectPage
Change-Id: I37330b10a302b8947dab574d90d06730e86f558e --- M scripts/interwiki.py 1 file changed, 9 insertions(+), 9 deletions(-)
Approvals: Dvorapa: Looks good to me, approved jenkins-bot: Verified
diff --git a/scripts/interwiki.py b/scripts/interwiki.py index e6894ca..dcfbbf9 100755 --- a/scripts/interwiki.py +++ b/scripts/interwiki.py @@ -2246,18 +2246,18 @@
@rtype: bool """ + txt = page.text # Check if the page is in content namespace if page.namespace().content: # Check if the page contains at least 50 characters - return len(page.text) < 50 - else: - if not page.is_categorypage(): - txt = page.get() - txt = textlib.removeLanguageLinks(txt, site=page.site) - txt = textlib.removeCategoryLinks(txt, site=page.site) - return len(txt) < 4 - else: - return False + return len(txt) < 50 + + if not page.is_categorypage(): + txt = textlib.removeLanguageLinks(txt, site=page.site) + txt = textlib.removeCategoryLinks(txt, site=page.site) + return len(txt) < 4 + + return False
def main(*args):
pywikibot-commits@lists.wikimedia.org