jenkins-bot has submitted this change and it was merged.
Change subject: [FIX] MediaWikiVersion: Accept new wmf style
......................................................................
[FIX] MediaWikiVersion: Accept new wmf style
With 1.27 the wmf version style changed adding a dash and period:
* `MediaWiki 1.27.0-wmf.1`
* `MediaWiki 1.26wmf24`
Bug: T114189
Change-Id: I49a4f56c3a273e0315ea4fe7f755a954f64263e5
---
M pywikibot/tools/__init__.py
1 file changed, 5 insertions(+), 5 deletions(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/tools/__init__.py b/pywikibot/tools/__init__.py
index 4655d91..ce07b8d 100644
--- a/pywikibot/tools/__init__.py
+++ b/pywikibot/tools/__init__.py
@@ -422,7 +422,7 @@
"""
MEDIAWIKI_VERSION = re.compile(
- r'^(\d+(?:\.\d+)+)(wmf(\d+)|alpha|beta(\d+)|-?rc\.?(\d+)|.*)?$')
+ r'^(\d+(?:\.\d+)+)(-?wmf\.?(\d+)|alpha|beta(\d+)|-?rc\.?(\d+)|.*)?$')
@classmethod
def from_generator(cls, generator):
@@ -450,10 +450,10 @@
elif version_match.group(2) == 'alpha':
self._dev_version = (1, )
else:
- assert 'wmf' not in version_match.group(2)
- assert 'alpha' not in version_match.group(2)
- assert 'beta' not in version_match.group(2)
- assert 'rc' not in version_match.group(2)
+ for handled in ('wmf', 'alpha', 'beta',
'rc'):
+ # if any of those pops up here our parser has failed
+ assert handled not in version_match.group(2), \
+ 'Found "{0}" in "{1}"'.format(handled,
version_match.group(2))
if version_match.group(2):
debug('Additional unused version part '
'"{0}"'.format(version_match.group(2)),
--
To view, visit
https://gerrit.wikimedia.org/r/242373
To unsubscribe, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I49a4f56c3a273e0315ea4fe7f755a954f64263e5
Gerrit-PatchSet: 5
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: XZise <CommodoreFabianus(a)gmx.de>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: XZise <CommodoreFabianus(a)gmx.de>
Gerrit-Reviewer: jenkins-bot <>