jenkins-bot merged this change.
Follow PEP 8 in harvest_template.py
"If any return statement returns an expression, any return statements
where no value is returned should explicitly state this as return None..."
Change-Id: Ibeabdad4f4867946002020d5c92bde08c35ead6b
---
M scripts/harvest_template.py
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/scripts/harvest_template.py b/scripts/harvest_template.py
index 2db474e..bac674c 100755
--- a/scripts/harvest_template.py
+++ b/scripts/harvest_template.py
@@ -187,12 +187,12 @@
except pywikibot.exceptions.InvalidTitle:
pywikibot.error('%s is not a valid title so it cannot be linked. '
'Skipping.' % link_text)
- return
+ return None
if not linked_page.exists():
pywikibot.output('%s does not exist so it cannot be linked. '
'Skipping.' % (linked_page))
- return
+ return None
if linked_page.isRedirectPage():
linked_page = linked_page.getRedirectTarget()
@@ -205,11 +205,11 @@
if not linked_item or not linked_item.exists():
pywikibot.output('%s does not have a wikidata item to link with. '
'Skipping.' % (linked_page))
- return
+ return None
if linked_item.title() == item.title():
pywikibot.output('%s links to itself. Skipping.' % (linked_page))
- return
+ return None
return linked_item
To view, visit change 440548. To unsubscribe, or for help writing mail filters, visit settings.