fix unreachable code flagged by pylint