From 4838ca75349073e43c9634a0f1af6ecf49ea4511 Mon Sep 17 00:00:00 2001 From: Josh Strohminger Date: Wed, 16 Aug 2023 14:31:30 -0700 Subject: Support newer protoc version scheme that only includes the minor and patch versions If only the minor and patch versions are found, assume the major version is 3. --- tests/proto3_optional/SConscript | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/proto3_optional/SConscript b/tests/proto3_optional/SConscript index 520ae74..cdaa2a0 100644 --- a/tests/proto3_optional/SConscript +++ b/tests/proto3_optional/SConscript @@ -6,8 +6,8 @@ import re version = None if 'PROTOC_VERSION' in env: - match = re.search('([0-9]+).([0-9]+)', env['PROTOC_VERSION']) - version = (int(match.group(1)), int(match.group(2))) + match = re.search('(?:([0-9]+).)?([0-9]+).([0-9]+)', env['PROTOC_VERSION']) + version = (int(match.group(1) or 3), int(match.group(2)), int(match.group(3))) # Oneof is supported by protoc >= 3.12.0 if env.GetOption('clean') or (version and (version[0] > 3 or (version[0] == 3 and version[1] >= 12))): -- cgit v1.2.3