From bbc35eda186957d85e17943f1fa36a766649aee3 Mon Sep 17 00:00:00 2001 From: Simon Warta Date: Mon, 31 Jul 2017 21:18:36 +0200 Subject: Explicitly handle negative cases in supported_compiler() Two cases only returned a falsy None implicitly by reaching the end of the function: - when user's compiler is not listed in the list of compiler choices - when user's compiler version is None and the module requires a min version This changes no behavior. --- configure.py | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'configure.py') diff --git a/configure.py b/configure.py index 945146833..8557bb9cd 100755 --- a/configure.py +++ b/configure.py @@ -836,18 +836,23 @@ class ModuleInfo(InfoObject): return True # Maybe a versioned compiler dep - if cc_version != None: - for cc in self.cc: - try: - name, version = cc.split(":") - if name == ccinfo.basename: + for cc in self.cc: + try: + name, version = cc.split(":") + if name == ccinfo.basename: + if cc_version: min_cc_version = [int(v) for v in version.split('.')] cur_cc_version = [int(v) for v in cc_version.split('.')] # With lists of ints, this does what we want return cur_cc_version >= min_cc_version - except ValueError: - # No version part specified - pass + else: + # Compiler version unknown => module unsupported + return False + except ValueError: + # No version part specified + pass + + return False # compiler not listed return supported_isa_flags(ccinfo, arch) and supported_compiler(ccinfo, cc_version) -- cgit v1.2.3