compilers: Make CCompiler.find_library return value consistent

When the CCompiler.links method call in CCompiler.find_library fails,
find_library resorts to finding the library file itself. In this second
case, the return value is not a list, whereas if links suceeds, the
return value is a list. Make it so that find_library returns a list
in either case.
This commit is contained in:
Paulo Antonio Alvarez 2017-06-02 01:14:18 -03:00 committed by Jussi Pakkanen
parent 45cf4191cc
commit 73b0002793
1 changed files with 2 additions and 2 deletions

View File

@ -1381,10 +1381,10 @@ class CCompiler(Compiler):
for suffix in suffixes: for suffix in suffixes:
trial = os.path.join(d, 'lib' + libname + '.' + suffix) trial = os.path.join(d, 'lib' + libname + '.' + suffix)
if os.path.isfile(trial): if os.path.isfile(trial):
return trial return [trial]
trial2 = os.path.join(d, libname + '.' + suffix) trial2 = os.path.join(d, libname + '.' + suffix)
if os.path.isfile(trial2): if os.path.isfile(trial2):
return trial2 return [trial2]
return None return None
def thread_flags(self): def thread_flags(self):