jenkins-bot submitted this change.
api.py: buffer 'pageprops' in QueryGenerator
Currently, 'pageprops' is only cached if found in the response.
The API only returns this property if it's not empty, causing
repetitive queries if accessed multiple times.
This change caches 'pageprops' if it's requested, creating an
empty dictionary to use if it's not present in the response.
Change-Id: I30973b7479822ebc043f1d4db77522143e8c5652
---
M pywikibot/data/api.py
1 file changed, 2 insertions(+), 0 deletions(-)
diff --git a/pywikibot/data/api.py b/pywikibot/data/api.py
index ff90b25..4c34108 100644
--- a/pywikibot/data/api.py
+++ b/pywikibot/data/api.py
@@ -3173,6 +3173,8 @@
if 'pageprops' in pagedict:
page._pageprops = pagedict['pageprops']
+ elif 'pageprops' in props:
+ page._pageprops = {}
if 'preload' in pagedict:
page._preloadedtext = pagedict['preload']
To view, visit change 237113. To unsubscribe, or for help writing mail filters, visit settings.