g-ir-scanner runs _resolve_non_libtool even when there are no libtool libraries
This is related to #313 but is a different bug. In my case ldd should never be run at all because there are no non-libtool dependencies.
In resolve_shlibs
, it checks for non-libtool libraries like this:
non_libtool = filter(lambda x: not x.endswith(".la"), libraries)
Then it calls _resolve_non_libtool
on the result like this:
_resolve_non_libtool(options, binary, non_libtool)
That function immediately returns if no libraries are passed to it:
if not libraries:
return []
There is just one problem with this. In Python 3, filter
returns a filter object, not a list. A filter object casts to True
, so the non-libtool code always runs, even when it is not needed.
In Python 3 code:
>>> a = filter(lambda x: x == 0, [1, 2, 3])
>>> a
<filter object at 0x7fcc126613c8>
>>> bool(a)
True
>>> list(a)
[]
>>> bool(list(a))
False
>>>