def _check_libalternatives_presence(pkg, alts_requirement):
for path in pkg.files:
if path.startswith('/usr/share/libalternatives/'):
return True
return any(req[0] == alts_requirement for req in pkg.requires + pkg.prereq)
$ flake8 /tmp/snippet.py
/tmp/snippet.py:2:5: SIM110 Use 'return any(path.startswith('/usr/share/libalternatives/') for path in pkg.files)'
It's wrong as the last statement will be never executed.
Desired change
Example
It's wrong as the last statement will be never executed.