thriftpy2
thriftpy2 copied to clipboard
thriftpy2.load fail
我的thrift 文件如下: `namespace go test.test.test namespace py cg
struct Template { 1: optional string async 2: optional Test test
}
struct Test { 1: required string name } `
main函数如下:
`import os import sys import thriftpy2
if name == "main": thriftpy2.parser.lexer.thrift_reserved_keywords = [] IDL_PATH="./test.thrift" res = thriftpy2.load(IDL_PATH, module_name="cg_thrift")`
失败信息如下:
thriftpy2.parser.exc.ThriftParserError: No type found: 'Test', at line 6
如果把thrift 里面的 async 字段去掉就成功了