Do not assume that version placeholders contain ")"

This commit is contained in:
Martin Hořeňovský 2019-09-06 13:25:31 +02:00
parent 071bacad5e
commit 1189a73be2
No known key found for this signature in database
GPG Key ID: DE48307B8B0D381A

View File

@ -127,8 +127,8 @@ def updateVersionDefine(version):
def updateVersionPlaceholder(filename, version):
with open(filename, 'rb') as file:
lines = file.readlines()
placeholderRegex = re.compile(b'\) in Catch X.Y.Z')
replacement = '\) in Catch {}.{}.{}'.format(version.majorVersion, version.minorVersion, version.patchNumber).encode('ascii')
placeholderRegex = re.compile(b' in Catch X.Y.Z')
replacement = ' in Catch {}.{}.{}'.format(version.majorVersion, version.minorVersion, version.patchNumber).encode('ascii')
with open(filename, 'wb') as file:
for line in lines:
file.write(placeholderRegex.sub(replacement, line))