jenkins-bot merged this change.

View Change

Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
Don't waste the site object in SiteLink.__setitem__

This will use the cache more efficiently.

Change-Id: I87fb70134847aab804fc38adfd663ca454df6f53
---
M pywikibot/page.py
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pywikibot/page.py b/pywikibot/page.py
index 2fe987e..83a7104 100644
--- a/pywikibot/page.py
+++ b/pywikibot/page.py
@@ -6426,12 +6426,12 @@
@type val: dict or str
@rtype: SiteLink
"""
- if isinstance(key, pywikibot.site.BaseSite):
- key = key.dbName()
if isinstance(val, UnicodeType):
val = SiteLink(val, key)
else:
val = SiteLink.fromJSON(val, self.repo)
+ if isinstance(key, pywikibot.site.BaseSite):
+ key = key.dbName()
return super(SiteLinkCollection, self).__setitem__(key, val)



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

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I87fb70134847aab804fc38adfd663ca454df6f53
Gerrit-Change-Number: 517428
Gerrit-PatchSet: 1
Gerrit-Owner: Matěj Suchánek <matejsuchanek97@gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb@gmail.com>
Gerrit-Reviewer: Matěj Suchánek <matejsuchanek97@gmail.com>
Gerrit-Reviewer: Xqt <info@gno.de>
Gerrit-Reviewer: jenkins-bot (75)
Gerrit-CC: Lokal Profil <andre.costa@wikimedia.se>