提交 05d5b00b 编写于 作者: C chentianyu03

adapt to python3

上级 3c4c712f
...@@ -90,7 +90,7 @@ def is_filter_api(api): ...@@ -90,7 +90,7 @@ def is_filter_api(api):
return True return True
#check api in alias map #check api in alias map
if alias_api_map.has_key(api): if api in alias_api_map:
return False return False
#check api start with paddle.fluid #check api start with paddle.fluid
...@@ -109,7 +109,7 @@ def is_filter_api(api): ...@@ -109,7 +109,7 @@ def is_filter_api(api):
#if the api in alias_map key, others api is alias api #if the api in alias_map key, others api is alias api
for x in same_apis: for x in same_apis:
if alias_api_map.has_key(x): if x in alias_api_map:
return True return True
if len(same_apis) > 1: if len(same_apis) > 1:
...@@ -129,7 +129,7 @@ def is_filter_api(api): ...@@ -129,7 +129,7 @@ def is_filter_api(api):
def get_display_api(api): def get_display_api(api):
# recomment alias api # recomment alias api
if api.startswith("paddle.fluid") and alias_api_map.has_key(api): if api.startswith("paddle.fluid") and api in alias_api_map:
return alias_api_map[api][0] return alias_api_map[api][0]
else: else:
return api return api
...@@ -213,8 +213,7 @@ class EnDocGenerator(object): ...@@ -213,8 +213,7 @@ class EnDocGenerator(object):
#print("attribute error: module_name=" + self.module_name + ", api=" + self.api) #print("attribute error: module_name=" + self.module_name + ", api=" + self.api)
pass pass
else: else:
if isinstance( if isinstance(eval(self.module_name + "." + self.api), type):
eval(self.module_name + "." + self.api), types.TypeType):
self.print_class() self.print_class()
elif isinstance( elif isinstance(
eval(self.module_name + "." + self.api), eval(self.module_name + "." + self.api),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册