未验证 提交 6c9f0abe 编写于 作者: T Tony Cao 提交者: GitHub

[CodeStyle][W601] Replace .has_key() with 'in' (#46702)

上级 c64e1dcf
...@@ -100,7 +100,7 @@ class FileReader(object): ...@@ -100,7 +100,7 @@ class FileReader(object):
self._logger.info(self._minTimeStamp) self._logger.info(self._minTimeStamp)
def _checkArgsKey(self, key, type): def _checkArgsKey(self, key, type):
if not self._args.has_key(key): if key not in self._args:
raise KeyError("args should has key [%s]!" % key) raise KeyError("args should has key [%s]!" % key)
if not isinstance(self._args[key], type): if not isinstance(self._args[key], type):
......
...@@ -60,10 +60,10 @@ class profileFileReader(FileReader): ...@@ -60,10 +60,10 @@ class profileFileReader(FileReader):
def _is_forwardBackwardInfo(self, items): def _is_forwardBackwardInfo(self, items):
if items["name"] == "marker/compute/MarkerCUDA": if items["name"] == "marker/compute/MarkerCUDA":
if items.has_key("args"): if "args" in items:
if isinstance(items["args"], dict): if isinstance(items["args"], dict):
args = items["args"] args = items["args"]
if args.has_key("detail_info"): if "detail_info" in args:
if args["detail_info"] == "marker_forward_B" or \ if args["detail_info"] == "marker_forward_B" or \
args["detail_info"] == "marker_forward_E" or \ args["detail_info"] == "marker_forward_E" or \
args["detail_info"] == "marker_backward_B" or \ args["detail_info"] == "marker_backward_B" or \
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册