jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/425855 )
Change subject: [bugfix] fix cache attribute Page._depth ......................................................................
[bugfix] fix cache attribute Page._depth
currently the depth isn't cached
Change-Id: I192c791d626a25a3c3384653c8d9f6c51e3ba51b --- M pywikibot/page.py 1 file changed, 3 insertions(+), 3 deletions(-)
Approvals: Framawiki: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/page.py b/pywikibot/page.py index 46a43e1..1eac027 100644 --- a/pywikibot/page.py +++ b/pywikibot/page.py @@ -274,12 +274,12 @@ if not hasattr(self, '_depth'): # Check if the namespace allows subpages if self._namespace_obj.subpages: - _depth = self.title().count('/') + self._depth = self.title().count('/') else: # Does not allow subpages, which means depth is always 0 - _depth = 0 + self._depth = 0
- return _depth + return self._depth
@property def pageid(self):
pywikibot-commits@lists.wikimedia.org