Fix syntax error under python3 for 'list' command