jenkins-bot merged this change.

View Change

Approvals: Dalba: Looks good to me, approved jenkins-bot: Verified
[bugfix] Don't reset Bot._site to None if we have already a site object

Bug: T125046
Change-Id: Id900d93b6235ea4ec60a0db97d7b7da2828fcaad
M pywikibot/
1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/pywikibot/ b/pywikibot/
index 2708755..d450a6d 100644
--- a/pywikibot/
+++ b/pywikibot/
@@ -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.

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Id900d93b6235ea4ec60a0db97d7b7da2828fcaad
Gerrit-Change-Number: 266994
Gerrit-PatchSet: 3
Gerrit-Owner: Xqt <>
Gerrit-Reviewer: Dalba <>
Gerrit-Reviewer: John Vandenberg <>
Gerrit-Reviewer: Mpaa <>
Gerrit-Reviewer: Xqt <>
Gerrit-Reviewer: jenkins-bot (75)