jenkins-bot has submitted this change. ( 
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1082153?usp=email )

Change subject: [bugfix] Fix argument for NoWikibaseEntityError
......................................................................

[bugfix] Fix argument for NoWikibaseEntityError

The exception class overrides the initializer and does not
accept another exception instance. Pass it a (fake) entity
to avoid AttributeError.

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

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




diff --git a/pywikibot/page/_wikibase.py b/pywikibot/page/_wikibase.py
index afb189b..6b0ad93 100644
--- a/pywikibot/page/_wikibase.py
+++ b/pywikibot/page/_wikibase.py
@@ -1458,8 +1458,11 @@
         """
         try:
             prop_type = self.repo.getPropertyType(self)
-        except KeyError as e:
-            raise NoWikibaseEntityError(e)
+        except KeyError:
+            raise NoWikibaseEntityError(
+                self if isinstance(self, WikibaseEntity)
+                else WikibaseEntity(self.repo, self.id)
+            ) from None

         return prop_type


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

Gerrit-MessageType: merged
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I91f2c24a846f3edc2dbbf5eefebf922d5ea30e7e
Gerrit-Change-Number: 1082153
Gerrit-PatchSet: 3
Gerrit-Owner: Matěj Suchánek <matejsuchane...@gmail.com>
Gerrit-Reviewer: Xqt <i...@gno.de>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
Pywikibot-commits mailing list -- pywikibot-commits@lists.wikimedia.org
To unsubscribe send an email to pywikibot-commits-le...@lists.wikimedia.org

Reply via email to