jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/714201 )
Change subject: [bugfix] Ignore Site() results of None in script_tests ......................................................................
[bugfix] Ignore Site() results of None in script_tests
script_tests.py overrides pywikibot.Site() with None and bot.init_handlers() may fail then. Ignore a None site.
Bug: T289427 Change-Id: I50f8f5a6bc5fcf55c7563819c445475716826a00 --- M pywikibot/bot.py 1 file changed, 2 insertions(+), 0 deletions(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/bot.py b/pywikibot/bot.py index a623dff..3197e60 100644 --- a/pywikibot/bot.py +++ b/pywikibot/bot.py @@ -398,6 +398,8 @@ if pywikibot.Site.__doc__ != 'TEST': # set by aspects.DisableSiteMixin try: # T286848 site = pywikibot.Site() + if site is None: # T289427 + raise ValueError('Running script_test with net=False') except ValueError: pass else: # get PID
pywikibot-commits@lists.wikimedia.org