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
pywikibot-commits@lists.wikimedia.org