提交 ad6ed5b7 编写于 作者: X Xin Pan

fix py3

test=develop
上级 0cc9ab3d
......@@ -417,8 +417,6 @@ paddle.reader.compose ArgSpec(args=[], varargs='readers', keywords='kwargs', def
paddle.reader.chain ArgSpec(args=[], varargs='readers', keywords=None, defaults=None)
paddle.reader.shuffle ArgSpec(args=['reader', 'buf_size'], varargs=None, keywords=None, defaults=None)
paddle.reader.ComposeNotAligned.__init__
paddle.reader.ComposeNotAligned.args.__init__
paddle.reader.ComposeNotAligned.message.__init__
paddle.reader.firstn ArgSpec(args=['reader', 'n'], varargs=None, keywords=None, defaults=None)
paddle.reader.xmap_readers ArgSpec(args=['mapper', 'reader', 'process_num', 'buffer_size', 'order'], varargs=None, keywords=None, defaults=(False,))
paddle.reader.PipeReader.__init__ ArgSpec(args=['self', 'command', 'bufsize', 'file_type'], varargs=None, keywords=None, defaults=(8192, 'plain'))
......
......@@ -459,6 +459,7 @@ function assert_api_not_changed() {
# Use sed to make python2 and python3 sepc keeps the same
sed -i 's/arg0: str/arg0: unicode/g' new.spec
sed -i "s/\(.*Transpiler.*\).__init__ ArgSpec(args=\['self'].*/\1.__init__ /g" new.spec
sed -i 's/\(.*ComposeNotAligned.*\).__init__ ArgSpec(args=.*/\1.__init__ /g' new.spec
fi
python ${PADDLE_ROOT}/tools/diff_api.py ${PADDLE_ROOT}/paddle/fluid/API.spec new.spec
deactivate
......
......@@ -30,7 +30,7 @@ member_dict = collections.OrderedDict()
def visit_member(parent_name, member):
cur_name = ".".join([parent_name, member.__name__])
if inspect.isclass(member) or inspect.isgetsetdescriptor(member):
if inspect.isclass(member):
for name, value in inspect.getmembers(member):
if hasattr(value, '__name__') and (not name.startswith("_") or
name == "__init__"):
......@@ -43,7 +43,8 @@ def visit_member(parent_name, member):
line.strip() for line in pydoc.render_doc(member).split('\n')
if "->" in line
])
elif inspect.isgetsetdescriptor(member):
return
else:
raise RuntimeError("Unsupported generate signature of member, type {0}".
format(str(type(member))))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册