jenkins-bot has submitted this change and it was merged.
Change subject: Fixup 920ba1f - make -help work again ......................................................................
Fixup 920ba1f - make -help work again
We need to explicitly use pywikibot.argvu, or else two copies of this array will be floating around (pywikibot.argvu and pywikibot.bot.argvu). Setting it explicitly on pywikibot makes sure the second one doesn't exist. Furthermore, make sure the script name parser uses the working argvu. Lastly, make the generic argument parser call pywikibot.argvu instead of re-importing argvu locally.
Change-Id: I35ce3582bb74037d517a714d9d5f467d6b868bdb --- M pywikibot/bot.py 1 file changed, 3 insertions(+), 4 deletions(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/bot.py b/pywikibot/bot.py index bb793c8..ca06ce0 100644 --- a/pywikibot/bot.py +++ b/pywikibot/bot.py @@ -40,7 +40,7 @@ % config.userinterface, fromlist=['UI']) ui = uiModule.UI() -argvu = ui.argvu() +pywikibot.argvu = ui.argvu()
# Logging module configuration @@ -501,7 +501,7 @@
""" # get commandline arguments - called = argvu[0].strip() + called = pywikibot.argvu[0].strip() if ".py" in called: # could end with .pyc, .pyw, etc. on some platforms # clip off the '.py?' filename extension called = called[:called.rindex('.py')] @@ -523,8 +523,7 @@ if not args: # it's the version in pywikibot.__init__ that is changed by scripts, # not the one in pywikibot.bot. - from pywikibot import argvu - args = argvu[1:] + args = pywikibot.argvu[1:] # get the name of the module calling this function. This is # required because the -help option loads the module's docstring and because # the module name will be used for the filename of the log.
pywikibot-commits@lists.wikimedia.org