jenkins-bot has submitted this change and it was merged.
Change subject: [IMPR] Upcast PageGenerator to User Page subclass when namespace is 2 ......................................................................
[IMPR] Upcast PageGenerator to User Page subclass when namespace is 2
Change-Id: Ibe14a4acdbf0ea1e345c7e9e0654e302c1d6e528 --- M pywikibot/data/api.py 1 file changed, 3 insertions(+), 1 deletion(-)
Approvals: Mpaa: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/data/api.py b/pywikibot/data/api.py index a42caf6..1969c90 100644 --- a/pywikibot/data/api.py +++ b/pywikibot/data/api.py @@ -2863,7 +2863,9 @@ p = pywikibot.Page(self.site, pagedata['title'], pagedata['ns']) ns = pagedata['ns'] # Upcast to proper Page subclass. - if ns == 6: + if ns == 2: + p = pywikibot.User(p) + elif ns == 6: p = pywikibot.FilePage(p) elif ns == 14: p = pywikibot.Category(p)
pywikibot-commits@lists.wikimedia.org