Open JonnoFTW opened 4 years ago
Thank you, I think it should be fixed.
@ethe after digging around in the code, it looks like these thrift_spec
s are being generated in _make_service
here:
Which comes from funcs
which are a ply.yacc.YaccProduction
which are generated by ply
.
At this point I can only only see some kind of monkey-patching fix to replace the module instance after the service class is generated. Maybe there's some other way to do it but I'm not sure.
I have an issue when trying to raise and catch the exact exception from an included file. My thrift is:
The following pytest code succeeds:
Changing
test_errors_thrift
to:Causes the test to fail. I suspect this is because
test_thrift.TestService.do_error_result.thrift_spec
is:But the error raised is a:
So it can't actually raise the error correctly because it can't be put into the error result because:
returns
False
, perTProcessor.handle_exception
from: https://github.com/Thriftpy/thriftpy2/blob/a8b7873078a6f38a2f052964d439ab888e32fcf4/thriftpy2/thrift.py#L303-L312Would the correct fix here be to ensure that generated
thrift_spec
s use the custom module name?