@app.teardown_request
def teardown_request(error):
print('teardown_request')
#error 错误信息什么是才能打印
1 回答

慕斯卡4456334
TA贡献1条经验 获得超0个赞
你定义的不就是teardown_request(error)函数吗
你应该是用在某个判断语句里面把?
def teardown_request(): return 'teardown_request' age = ??? if age % 1 != 0: print teardown_request()
这就是我举的例子… def记得return…
添加回答
举报
0/150
提交
取消