Fix get_version.py script for more than 1 char (#1955)

This commit is contained in:
Florian Märkl 2019-12-20 23:05:43 +01:00 committed by GitHub
parent c0d4fda0c7
commit 4cce7cf22c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -9,7 +9,7 @@ with open(pro_file_path, "r") as f:
pro_content = f.read()
def version_var_re(name):
return "^[ \t]*{}[ \t]*=[ \t]*(\d)+[ \t]*$".format(name)
return "^[ \t]*{}[ \t]*=[ \t]*(\d+)[ \t]*$".format(name)
m = re.search(version_var_re("CUTTER_VERSION_MAJOR"), pro_content, flags=re.MULTILINE)
version_major = int(m.group(1)) if m is not None else 0