diff options
author | Craig Rodrigues <rodrigc@FreeBSD.org> | 2015-11-18 23:32:29 +0000 |
---|---|---|
committer | Craig Rodrigues <rodrigc@FreeBSD.org> | 2015-11-18 23:32:29 +0000 |
commit | aef675d879686dd34c3eb7dbadab7a872b3f3eba (patch) | |
tree | 5a5e32204f4c07db711039f190bb5c152599f8fd /tools/sched | |
parent | 69527b11bb5e1bb234a29eed864896cb1a13d652 (diff) | |
download | src-test-aef675d879686dd34c3eb7dbadab7a872b3f3eba.tar.gz src-test-aef675d879686dd34c3eb7dbadab7a872b3f3eba.zip |
Use 'in' instead of 'has_key()' for testing dictionary membership.
In PEP 0290, has_key() was deprecated in Python 2.2 and higher:
https://www.python.org/dev/peps/pep-0290/#testing-dictionary-membership
https://docs.python.org/2.2/whatsnew/node4.html
In Python 3, dict.has_key() was removed:
https://docs.python.org/3.0/whatsnew/3.0.html#builtins
Notes
Notes:
svn path=/head/; revision=291036
Diffstat (limited to 'tools/sched')
-rw-r--r-- | tools/sched/schedgraph.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/sched/schedgraph.py b/tools/sched/schedgraph.py index f0552cacdcc58..0723dc3324e79 100644 --- a/tools/sched/schedgraph.py +++ b/tools/sched/schedgraph.py @@ -461,7 +461,7 @@ class SourceStats(Toplevel): if (event.type == "pad"): continue duration = event.duration - if (eventtypes.has_key(event.name)): + if (event.name in eventtypes): (c, d) = eventtypes[event.name] c += 1 d += duration @@ -1069,7 +1069,7 @@ class KTRFile: def makeid(self, group, id, type): tag = group + id - if (self.taghash.has_key(tag)): + if (tag in self.taghash): return self.taghash[tag] if (type == "counter"): source = Counter(group, id) |