jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/688362 )
Change subject: [W0612] Hide unused loop variables ......................................................................
[W0612] Hide unused loop variables
Also fix addtext docstring
Change-Id: Ib8bfdea44590a63016c5f92edad5e59867adbd06 --- M scripts/add_text.py M tests/site_tests.py M tests/ui_tests.py 3 files changed, 7 insertions(+), 9 deletions(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/scripts/add_text.py b/scripts/add_text.py index 3588f11..f937434 100755 --- a/scripts/add_text.py +++ b/scripts/add_text.py @@ -171,13 +171,13 @@ @param always: Always add text without user confirmation @param up: If True, add text to top of page, else add at bottom. @param putText: If True, save changes to the page, else return - (_, newtext, _) + (text, newtext, always) @param oldTextGiven: If None fetch page text, else use this text @param reorderEnabled: If True place text above categories and interwiki, else place at page bottom. No effect if up = False. @param create: Create page if it does not exist @return: If putText=True: (success, success, always) - else: (_, newtext, _) + else: (text, newtext, always) """ site = page.site if not summary: @@ -343,11 +343,9 @@ if talkPage: generator = pagegenerators.PageWithTalkPageGenerator(generator, True) for page in generator: - (_, newtext, _) = add_text(page, addText, summary, - regexSkipUrl=regexSkipUrl, - always=always, up=up, - reorderEnabled=reorderEnabled, - create=talkPage) + add_text(page, addText, summary, + regexSkipUrl=regexSkipUrl, always=always, up=up, + reorderEnabled=reorderEnabled, create=talkPage)
if __name__ == '__main__': diff --git a/tests/site_tests.py b/tests/site_tests.py index 36cc1f4..4ffff26 100644 --- a/tests/site_tests.py +++ b/tests/site_tests.py @@ -953,7 +953,7 @@ """Test lock_page and unlock_page methods for multiple threads.""" # Start few threads threads = [] - for i in range(5): + for _ in range(5): thread = threading.Thread(target=self.worker) thread.setDaemon(True) thread.start() diff --git a/tests/ui_tests.py b/tests/ui_tests.py index 1cf3cad..0bfe4d8 100644 --- a/tests/ui_tests.py +++ b/tests/ui_tests.py @@ -638,7 +638,7 @@ 'Alpha Bετα Гамма دلتا\n') lines = []
- for i in range(3): + for _ in range(3): lines = self.getstdouterr().split('\n') if len(lines) >= 4 and 'Alpha' not in lines: # if len(lines) < 4, we assume not all lines had been output
pywikibot-commits@lists.wikimedia.org