summaryrefslogtreecommitdiffstats
path: root/Lib/pstats.py
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2002-06-01 14:18:47 (GMT)
committerRaymond Hettinger <python@rcn.com>2002-06-01 14:18:47 (GMT)
commit54f0222547b1e92cd018ef132307a6f793dc9505 (patch)
tree667480d89feb3f9c7ca44e4ffa7bf39e725c120d /Lib/pstats.py
parent9d5e4aa4149edb92f6d28c9390d776ae4a1d719a (diff)
downloadcpython-54f0222547b1e92cd018ef132307a6f793dc9505.zip
cpython-54f0222547b1e92cd018ef132307a6f793dc9505.tar.gz
cpython-54f0222547b1e92cd018ef132307a6f793dc9505.tar.bz2
SF 563203. Replaced 'has_key()' with 'in'.
Diffstat (limited to 'Lib/pstats.py')
-rw-r--r--Lib/pstats.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/Lib/pstats.py b/Lib/pstats.py
index f74bd15..126d0be 100644
--- a/Lib/pstats.py
+++ b/Lib/pstats.py
@@ -151,7 +151,7 @@ class Stats:
self.fcn_list = None
for func in other.stats.keys():
- if self.stats.has_key(func):
+ if func in self.stats:
old_func_stat = self.stats[func]
else:
old_func_stat = (0, 0, 0, 0, {},)
@@ -183,7 +183,7 @@ class Stats:
while fragment:
if not fragment:
break
- if dict.has_key(fragment):
+ if fragment in dict:
bad_list[fragment] = 0
break
dict[fragment] = self.sort_arg_dict_default[word]
@@ -243,7 +243,7 @@ class Stats:
for func2 in callers.keys():
newcallers[func_strip_path(func2)] = callers[func2]
- if newstats.has_key(newfunc):
+ if newfunc in newstats:
newstats[newfunc] = add_func_stats(
newstats[newfunc],
(cc, nc, tt, ct, newcallers))
@@ -264,11 +264,11 @@ class Stats:
if self.all_callees: return
self.all_callees = all_callees = {}
for func in self.stats.keys():
- if not all_callees.has_key(func):
+ if not func in all_callees:
all_callees[func] = {}
cc, nc, tt, ct, callers = self.stats[func]
for func2 in callers.keys():
- if not all_callees.has_key(func2):
+ if not func2 in all_callees:
all_callees[func2] = {}
all_callees[func2][func] = callers[func2]
return
@@ -354,7 +354,7 @@ class Stats:
self.print_call_heading(width, "called...")
for func in list:
- if self.all_callees.has_key(func):
+ if func in self.all_callees:
self.print_call_line(width, func, self.all_callees[func])
else:
self.print_call_line(width, func, {})
@@ -471,7 +471,7 @@ def add_callers(target, source):
for func in target.keys():
new_callers[func] = target[func]
for func in source.keys():
- if new_callers.has_key(func):
+ if func in new_callers:
new_callers[func] = source[func] + new_callers[func]
else:
new_callers[func] = source[func]