python - Twisted exception when using ReturnValue -
i`ve got exception when using returnvalue in function
@inlinecallbacks def my_func(id): yield somefunc(id) @inlinecallbacks def somefunc(id): somevar = yield func(id) returnvalue(somevar) returnvalue(somevar) file "/usr/lib64/python2.7/site-packages/twisted/internet/defer.py", line 1105, in returnvalue raise _defgen_return(val) twisted.internet.defer._defgen_return:
the function works fine, raises exception. how can avoid exception? need return value function.
returnvalue
uses exception trick return value/s. normal, exception not cause error.
detail: @inlinecallback
decorator looks like
def decorator(...) try: .... (func call & other logics) except exception myexcept: return myexcept.values
Comments
Post a Comment