From 0f623ad727f68b890d74deed2a3a609f80bd6ebf Mon Sep 17 00:00:00 2001 From: zhangchunle Date: Tue, 28 Jul 2020 14:01:14 +0800 Subject: [PATCH] fix apispec bug;test=document_fix (#25699) --- tools/print_signatures.py | 2 ++ tools/sampcd_processor.py | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/print_signatures.py b/tools/print_signatures.py index 6818c2550fd..76e1c8baddc 100644 --- a/tools/print_signatures.py +++ b/tools/print_signatures.py @@ -107,6 +107,8 @@ def visit_member(parent_name, member): visit_member(cur_name, value) elif inspect.ismethoddescriptor(member): return + elif inspect.isbuiltin(member): + return elif callable(member): queue_dict(member, cur_name) elif inspect.isgetsetdescriptor(member): diff --git a/tools/sampcd_processor.py b/tools/sampcd_processor.py index 0ef3a63f54a..102b50c43ae 100644 --- a/tools/sampcd_processor.py +++ b/tools/sampcd_processor.py @@ -470,7 +470,7 @@ def get_filenames(): except AttributeError: whl_error.append(api) continue - if len(module.split('.')) > 2: + if len(module.split('.')) > 1: filename = '../python/' module_py = '%s.py' % module.split('.')[-1] for i in range(0, len(module.split('.')) - 1): @@ -482,7 +482,9 @@ def get_filenames(): print("\n" + api + ' module is ' + module + "\n") if filename != '': # rm contrib file - if filename.startswith('../python/paddle/fluid/contrib'): + if filename.startswith( + '../python/paddle/fluid/contrib' + ) or filename == '../python/paddle/verison.py': pass elif filename not in filenames: filenames.append(filename) -- GitLab