jenkins-bot submitted this change.

View Change

Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
[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(-)

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

To view, visit change 714201. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I50f8f5a6bc5fcf55c7563819c445475716826a00
Gerrit-Change-Number: 714201
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <info@gno.de>
Gerrit-Reviewer: Xqt <info@gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged