jenkins-bot merged this change.

View Change

Approvals: Framawiki: Looks good to me, approved jenkins-bot: Verified
[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(-)

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):

To view, visit change 425855. To unsubscribe, visit settings.

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I192c791d626a25a3c3384653c8d9f6c51e3ba51b
Gerrit-Change-Number: 425855
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info@gno.de>
Gerrit-Reviewer: Framawiki <framawiki@tools.wmflabs.org>
Gerrit-Reviewer: John Vandenberg <jayvdb@gmail.com>
Gerrit-Reviewer: Zoranzoki21 <zorandori4444@gmail.com>
Gerrit-Reviewer: jenkins-bot <>