add extra none check in python completion script