jenkins-bot has submitted this change and it was merged.
Change subject: [IMPROV] ParamInfo: Use parameter info directly ......................................................................
[IMPROV] ParamInfo: Use parameter info directly
To determine the submodules on wikis before 1.26wmf9 it's iterating over the parameter names for a module and then requesting the parameter info even though it is already available for all parameters.
Change-Id: I765ccd47b63dc3c0907b1288964791c08369a1d6 --- M pywikibot/data/api.py 1 file changed, 4 insertions(+), 7 deletions(-)
Approvals: John Vandenberg: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/data/api.py b/pywikibot/data/api.py index d864abf..d25616c 100644 --- a/pywikibot/data/api.py +++ b/pywikibot/data/api.py @@ -686,10 +686,7 @@ submodules.add(child) else: # Boolean submodule info added to MW API in afa153ae - if self.site.version() >= MediaWikiVersion('1.24wmf18'): - params = set(param['name'] for param in parameters - if 'submodules' in param) - else: + if self.site.version() < MediaWikiVersion('1.24wmf18'): if module == 'main': params = set(['action']) elif module == 'query': @@ -700,10 +697,10 @@ if param['name'] in params: param['submodules'] = ''
- for param in params: - param = self.parameter(module, param) + for param in parameters: # Do not add format modules - if module != 'main' or param['name'] != 'format': + if 'submodules' in param and (module != 'main' or + param['name'] != 'format'): submodules |= set(param['type'])
if submodules:
pywikibot-commits@lists.wikimedia.org