Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nanopb/nanopb.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh Strohminger <joshstrohminger@users.noreply.github.com>2023-08-17 00:31:30 +0300
committerPetteri Aimonen <jpa@github.mail.kapsi.fi>2023-08-17 14:14:39 +0300
commit4838ca75349073e43c9634a0f1af6ecf49ea4511 (patch)
tree0a8598348014c0a1090788bf14f8a81d2dac9f2f
parentbc212bb780d84ee86257c4c4ed424f0ef96d4358 (diff)
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.
-rw-r--r--tests/proto3_optional/SConscript4
1 files 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))):