我有这个代码:
q = db.GqlQuery("SELECT * FROM UserData WHERE user_id = :1", current_user.user_id())
user_data = q.get()
if not user_data:
logging.error('a')
user_data = UserData(user_id = current_user.user_id(),
primary_email = current_email
)
user_data.put()
else:
logging.error(pprint.pprint(user_data))
它正在记录“无”,因为它正在运行其他。“如果不是user_data”不应该捕获“无”吗?