From f0a63e783d935324a2d20789ac72e9d8540470a3 Mon Sep 17 00:00:00 2001 From: Matt Martz Date: Fri, 1 Mar 2019 11:56:33 -0600 Subject: [PATCH] validate-modules improve empty version_added handling (#53177) * Improve empty version_added handling * Remove unrelated ignore --- test/sanity/validate-modules/main.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/test/sanity/validate-modules/main.py b/test/sanity/validate-modules/main.py index e11eb6ea53..f5f3dfb995 100755 --- a/test/sanity/validate-modules/main.py +++ b/test/sanity/validate-modules/main.py @@ -1370,7 +1370,8 @@ class ModuleValidator(Validator): return try: - mod_version_added = StrictVersion( + mod_version_added = StrictVersion() + mod_version_added.parse( str(existing_doc.get('version_added', '0.0')) ) except ValueError: @@ -1415,11 +1416,11 @@ class ModuleValidator(Validator): continue try: - version_added = StrictVersion( + version_added = StrictVersion() + version_added.parse( str(details.get('version_added', '0.0')) ) - version_added.version - except (ValueError, AttributeError): + except ValueError: version_added = details.get('version_added', '0.0') self.reporter.error( path=self.object_path,