jenkins-bot merged this change.
[bugfix] Don't reset Bot._site to None if we have already a site object
Bug: T125046
Change-Id: Id900d93b6235ea4ec60a0db97d7b7da2828fcaad
---
M pywikibot/bot.py
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/pywikibot/bot.py b/pywikibot/bot.py
index 2708755..d450a6d 100644
--- a/pywikibot/bot.py
+++ b/pywikibot/bot.py
@@ -1537,11 +1537,15 @@
instead which specifically handle multiple or single sites.
"""
- def __init__(self, **kwargs):
+ def __init__(self, site=None, **kwargs):
"""Create a Bot instance and initalize cached sites."""
# TODO: add warning if site is specified and generator
# contains pages from a different site.
- self._site = kwargs.pop('site', None)
+ # Do not set self._site to None if we already have it
+ if site is not None:
+ self._site = site
+ elif not hasattr(self, '_site'):
+ self._site = None
self._sites = set([self._site] if self._site else [])
super(Bot, self).__init__(**kwargs)
To view, visit change 266994. To unsubscribe, or for help writing mail filters, visit settings.