Build: rewrite my_exec_command to avoid catching AttributeError