catch NoneType syntax error to avoid python's printed stack trace