jenkins-bot has submitted this change and it was merged.
Change subject: Allow empty match replace
......................................................................
Allow empty match replace
back merge from 100333 from pywikibot/core.git
Change-Id: I99c2a97bc2963e6ae1f2cc26cedd5da8fb8bf5e0
---
M pywikibot/textlib.py
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/textlib.py b/pywikibot/textlib.py
index 30d78b6..bb6fb9a 100644
--- a/pywikibot/textlib.py
+++ b/pywikibot/textlib.py
@@ -224,7 +224,7 @@
int(groupMatch.group('number')))
try:
replacement = (replacement[:groupMatch.start()] +
- match.group(groupID) + \
+ ('' if match.group(groupID) is None else
match.group(groupID)) + \
replacement[groupMatch.end():])
except IndexError:
pywikibot.output('\nInvalid group reference: %s' %
groupID)
--
To view, visit
https://gerrit.wikimedia.org/r/104126
To unsubscribe, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I99c2a97bc2963e6ae1f2cc26cedd5da8fb8bf5e0
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/compat
Gerrit-Branch: master
Gerrit-Owner: Eranroz <eranroz89(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Matanya <matanya(a)foss.co.il>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot