From 87ea41d023a985c5ecee0370c7f7381c8a8cee52 Mon Sep 17 00:00:00 2001 From: Austin Anderson <angerson@google.com> Date: Thu, 4 Apr 2019 10:03:50 -0700 Subject: [PATCH] Fix configure.py to properly compare "X.Y.Z" with "X.Y" Right now, "0.24" is treated as lower than "*.*.*" because of the odd comparison method that adds digits to each existing section. This change converts "0.24" to "0.24.0" to fix that. This will probably need to be pulled into r2.0. PiperOrigin-RevId: 241950768 --- configure.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/configure.py b/configure.py index 65152169ebe..43d6a71c0ef 100644 --- a/configure.py +++ b/configure.py @@ -447,6 +447,9 @@ def convert_version_to_int(version): """ version = version.split('-')[0] version_segments = version.split('.') + # Treat "0.24" as "0.24.0" + if len(version_segments) == 2: + version_segments.append('0') for seg in version_segments: if not seg.isdigit(): return None