我在 web2py 模块中使用了一个应该引发 HTTP 异常的函数。对于大多数功能(例如T
)我做
from gluon import current
def f(x):
return current.T(x)
但我不能做例如raise current.HTTP(...)
:我明白了
<type 'exceptions.AttributeError'> 'thread._local' object has no attribute 'HTTP'
那么有什么方法可以在 web2py 模块中使用 HTTP() 吗?