jenkins-bot has submitted this change and it was merged.

Change subject: replace.py: fix display_edit_counter_feature
......................................................................


replace.py: fix display_edit_counter_feature

Solution 1) as suggested in the bug description.
Avoiding scoping issues when replace is unloaded.

Bug: 72942
Change-Id: I27e5b003bb1c7ddbcafca192b366c4a710ef9144
---
M scripts/replace.py
1 file changed, 4 insertions(+), 5 deletions(-)

Approvals:
  John Vandenberg: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/scripts/replace.py b/scripts/replace.py
index b5e4ec7..c40ca69 100755
--- a/scripts/replace.py
+++ b/scripts/replace.py
@@ -720,11 +720,10 @@
     pywikibot.Site().login()
     bot.run()
 
-    def display_edit_counter(bot):
-        pywikibot.output(u'\n%s pages changed.' % bot.changed_pages)
-
-    # Queue last request to display number of changed pages.
-    pywikibot.async_request(display_edit_counter, bot)
+    # Explicitly call pywikibot.stopme().
+    # It will make sure the callback is triggered before replace.py is 
unloaded.
+    pywikibot.stopme()
+    pywikibot.output(u'\n%s pages changed.' % bot.changed_pages)
 
 
 if __name__ == "__main__":

-- 
To view, visit https://gerrit.wikimedia.org/r/172044
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I27e5b003bb1c7ddbcafca192b366c4a710ef9144
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Mpaa <[email protected]>
Gerrit-Reviewer: John Vandenberg <[email protected]>
Gerrit-Reviewer: Ladsgroup <[email protected]>
Gerrit-Reviewer: Merlijn van Deen <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
Pywikibot-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot-commits

Reply via email to