jenkins-bot has submitted this change. ( 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/663808 )

Change subject: [IMPR] Use DataSite.get_entity_for_entity_id in 
DataSite._wbset_action
......................................................................

[IMPR] Use DataSite.get_entity_for_entity_id in DataSite._wbset_action

There is (will be) more than just items.

Change-Id: I5022178e43e9d1ee744c7ace034d5539bbf6ec75
---
M pywikibot/site/_datasite.py
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  Xqt: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/pywikibot/site/_datasite.py b/pywikibot/site/_datasite.py
index 6bf439c..89ea1f6 100644
--- a/pywikibot/site/_datasite.py
+++ b/pywikibot/site/_datasite.py
@@ -781,7 +781,7 @@

     def _wbset_action(self, itemdef, action, action_data, **kwargs):
         """
-        Execute wbset{action}' on a Wikibase item.
+        Execute wbset{action}' on a Wikibase entity.

         Supported actions are:
             wbsetaliases, wbsetdescription, wbsetlabel and wbsetsitelink
@@ -854,7 +854,7 @@

         # prefer ID over (site, title)
         if isinstance(itemdef, str):
-            itemdef = pywikibot.ItemPage(self, itemdef)
+            itemdef = self.get_entity_for_entity_id(itemdef)
         elif isinstance(itemdef, pywikibot.Page):
             try:
                 itemdef = itemdef.data_item()

--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/663808
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.wikimedia.org/r/settings

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I5022178e43e9d1ee744c7ace034d5539bbf6ec75
Gerrit-Change-Number: 663808
Gerrit-PatchSet: 4
Gerrit-Owner: Matěj Suchánek <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
_______________________________________________
Pywikibot-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot-commits

Reply via email to