jenkins-bot merged this change.

View Change

Approvals: Dalba: Looks good to me, approved jenkins-bot: Verified
[cleanup] use site.mw_version instead of MediaWikiVersion(site.version())

Change-Id: I2ab5b1b40d4542cc0b1a6d7ae56576067f0f3c95
---
M pywikibot/data/api.py
1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/pywikibot/data/api.py b/pywikibot/data/api.py
index 64223ce..9995a9c 100644
--- a/pywikibot/data/api.py
+++ b/pywikibot/data/api.py
@@ -38,7 +38,7 @@
Error, TimeoutError, InvalidTitle, UnsupportedPage
)
from pywikibot.tools import (
- MediaWikiVersion, deprecated, itergroup, ip, PY2, PYTHON_VERSION,
+ deprecated, itergroup, ip, PY2, PYTHON_VERSION,
getargspec, UnicodeType, remove_last_args
)
from pywikibot.tools.formatter import color_format
@@ -366,7 +366,7 @@
],
}

- if _mw_ver >= MediaWikiVersion('1.12'):
+ if _mw_ver >= '1.12':
return

query_help_list_prefix = "Values (separate with '|'): "
@@ -1692,14 +1692,11 @@
# When neither 'continue' nor 'rawcontinue' is present and the
# version number is at least 1.25wmf5 we add a dummy rawcontinue
# parameter. Querying siteinfo is save as it adds 'continue'.
- if ('continue' not in self._params and
- 'rawcontinue' not in self._params and
- MediaWikiVersion(
- self.site.version()) >= MediaWikiVersion('1.25wmf5')):
+ if ('continue' not in self._params
+ and 'rawcontinue' not in self._params
+ and self.site.mw_version >= '1.25wmf5'):
self._params['rawcontinue'] = ['']
- elif (self.action == 'help'
- and MediaWikiVersion(self.site.version())
- > MediaWikiVersion('1.24')):
+ elif self.action == 'help' and self.site.mw_version > '1.24':
self._params['wrap'] = ['']

if 'maxlag' not in self._params and config.maxlag:

To view, visit change 477172. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I2ab5b1b40d4542cc0b1a6d7ae56576067f0f3c95
Gerrit-Change-Number: 477172
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info@gno.de>
Gerrit-Reviewer: Dalba <dalba.wiki@gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb@gmail.com>
Gerrit-Reviewer: jenkins-bot (75)