diff --git a/tools/CrossStackProfiler/CspFileReader.py b/tools/CrossStackProfiler/CspFileReader.py index bafe9a03efe013b8b9c7a084937783b1e2fa49b5..475da769936a772dd98f7a5fda663cabb7091eb6 100755 --- a/tools/CrossStackProfiler/CspFileReader.py +++ b/tools/CrossStackProfiler/CspFileReader.py @@ -100,7 +100,7 @@ class FileReader(object): self._logger.info(self._minTimeStamp) 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) if not isinstance(self._args[key], type): diff --git a/tools/CrossStackProfiler/ProfileFileReader.py b/tools/CrossStackProfiler/ProfileFileReader.py index 628592a159f82c8cf1acc7ffb9b522be79558a46..6fb7d87fd47542920d0e166fb732fce9892a2e4e 100755 --- a/tools/CrossStackProfiler/ProfileFileReader.py +++ b/tools/CrossStackProfiler/ProfileFileReader.py @@ -60,10 +60,10 @@ class profileFileReader(FileReader): def _is_forwardBackwardInfo(self, items): if items["name"] == "marker/compute/MarkerCUDA": - if items.has_key("args"): + if "args" in items: if isinstance(items["args"], dict): args = items["args"] - if args.has_key("detail_info"): + if "detail_info" in args: if args["detail_info"] == "marker_forward_B" or \ args["detail_info"] == "marker_forward_E" or \ args["detail_info"] == "marker_backward_B" or \