jenkins-bot has submitted this change and it was merged.
Change subject: User: check that the '_userprops' attribute exists before deleting it ......................................................................
User: check that the '_userprops' attribute exists before deleting it
Otherwise an AttributeError might be raised if it hasn't been loaded yet.
Change-Id: I37428175177e4f1b4811b19465a5783ff565d995 --- M pywikibot/page.py 1 file changed, 1 insertion(+), 1 deletion(-)
Approvals: Merlijn van Deen: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/page.py b/pywikibot/page.py index 90efda1..2bf4bd7 100644 --- a/pywikibot/page.py +++ b/pywikibot/page.py @@ -2699,7 +2699,7 @@
@return: dict """ - if force: + if force and hasattr(self, '_userprops'): del self._userprops if not hasattr(self, '_userprops'): self._userprops = list(self.site.users([self.username, ]))[0]