jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/677099 )
Change subject: [bugfix] key, values pairs of dicts must be unpacked with items() ......................................................................
[bugfix] key, values pairs of dicts must be unpacked with items()
Bug: T188179 Change-Id: I539736f84619a05e46d4ddc07a2c6f8a90bbff3c --- M pywikibot/site/_interwikimap.py 1 file changed, 4 insertions(+), 4 deletions(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/site/_interwikimap.py b/pywikibot/site/_interwikimap.py index 8f456b7..026ca0f 100644 --- a/pywikibot/site/_interwikimap.py +++ b/pywikibot/site/_interwikimap.py @@ -6,6 +6,8 @@ # import pywikibot
+from pywikibot.backports import Set +
class _IWEntry:
@@ -79,13 +81,11 @@ raise TypeError('_iw_sites[%s] is wrong type: %s' % (prefix, type(self._iw_sites[prefix].site)))
- def get_by_url(self, url): + def get_by_url(self, url: str) -> Set[str]: """ Return a set of prefixes applying to the URL.
@param url: URL for the interwiki - @type url: str - @rtype: set """ - return {prefix for prefix, iw_entry in self._iw_sites + return {prefix for prefix, iw_entry in self._iw_sites.items() if iw_entry.url == url}
pywikibot-commits@lists.wikimedia.org