jenkins-bot has submitted this change and it was merged.
Change subject: remove unused "global" declaration; remove obsolete stopme() ......................................................................
remove unused "global" declaration; remove obsolete stopme()
bot object is never used as global variable. The global declaration is obsolete.
In core branch pywikibot.stopme() is called by atexit library. The function is executed upon normal program termination. This patch prohibits executing it twice.
Change-Id: I8d7c07cd058f6c7db236c84ab461489b5fbfc088 --- M scripts/category_redirect.py 1 file changed, 9 insertions(+), 13 deletions(-)
Approvals: Merlijn van Deen: Looks good to me, approved jenkins-bot: Verified
diff --git a/scripts/category_redirect.py b/scripts/category_redirect.py index 7e71e1c..48bcc93 100755 --- a/scripts/category_redirect.py +++ b/scripts/category_redirect.py @@ -15,7 +15,7 @@ """
# -# (C) Pywikibot team, 2008-2013 +# (C) Pywikibot team, 2008-2014 # # Distributed under the terms of the MIT license. # @@ -414,18 +414,14 @@
def main(*args): - global bot - try: - a = pywikibot.handleArgs(*args) - if len(a) == 1: - raise RuntimeError('Unrecognized argument "%s"' % a[0]) - elif a: - raise RuntimeError('Unrecognized arguments: ' + - " ".join(('"%s"' % arg) for arg in a)) - bot = CategoryRedirectBot() - bot.run() - finally: - pywikibot.stopme() + a = pywikibot.handleArgs(*args) + if len(a) == 1: + raise RuntimeError('Unrecognized argument "%s"' % a[0]) + elif a: + raise RuntimeError('Unrecognized arguments: ' + + " ".join(('"%s"' % arg) for arg in a)) + bot = CategoryRedirectBot() + bot.run()
if __name__ == "__main__": main()
pywikibot-commits@lists.wikimedia.org