From ad6ed5b745dbaa64dc6ba3c48443adbc63c50aa7 Mon Sep 17 00:00:00 2001 From: Xin Pan Date: Wed, 28 Nov 2018 18:58:57 +0800 Subject: [PATCH] fix py3 test=develop --- paddle/fluid/API.spec | 2 -- paddle/scripts/paddle_build.sh | 1 + tools/print_signatures.py | 5 +++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/paddle/fluid/API.spec b/paddle/fluid/API.spec index 092008aa8..5e0756e53 100644 --- a/paddle/fluid/API.spec +++ b/paddle/fluid/API.spec @@ -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')) diff --git a/paddle/scripts/paddle_build.sh b/paddle/scripts/paddle_build.sh index 63707245e..32de51afb 100755 --- a/paddle/scripts/paddle_build.sh +++ b/paddle/scripts/paddle_build.sh @@ -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 diff --git a/tools/print_signatures.py b/tools/print_signatures.py index 83f6434df..5c5266f90 100644 --- a/tools/print_signatures.py +++ b/tools/print_signatures.py @@ -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)))) -- GitLab