jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/513574 )
Change subject: [cleanup] return has_extension result in deprecated hasExtension method ......................................................................
[cleanup] return has_extension result in deprecated hasExtension method
use remove_last_args to ignore the old "unknown" parameter
Change-Id: I53ebe1aa802b4ca18e3c03613a1464cac0af0bf4 --- M pywikibot/site.py 1 file changed, 3 insertions(+), 19 deletions(-)
Approvals: Dvorapa: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/site.py b/pywikibot/site.py index c329a87..18a745d 100644 --- a/pywikibot/site.py +++ b/pywikibot/site.py @@ -2660,26 +2660,10 @@ return _namespaces
@deprecated('has_extension', since='20140819') + @remove_last_args(('unknown', )) def hasExtension(self, name, unknown=None): - """Determine whether extension `name` is loaded. - - Use L{has_extension} instead! - - @param name: The extension to check for, case insensitive - @type name: str - @param unknown: Old parameter which shouldn't be used anymore. - @return: If the extension is loaded - @rtype: bool - """ - if unknown is not None: - pywikibot.debug('unknown argument of hasExtension is deprecated.', - _logger) - extensions = self.siteinfo['extensions'] - name = name.lower() - for ext in extensions: - if ext['name'].lower() == name: - return True - return False + """DEPRECATED. Determine whether extension `name` is loaded.""" + return self.has_extension(name)
def has_extension(self, name): """Determine whether extension `name` is loaded.
pywikibot-commits@lists.wikimedia.org