#4578: fix has_key() usage in compiler package.

This commit is contained in:
Georg Brandl 2008-12-15 08:58:59 +00:00
parent cbc1ed5e28
commit 2d2fe572a4
5 changed files with 16 additions and 18 deletions

View file

@ -210,7 +210,7 @@ def dfs_postorder(b, seen):
order = []
seen[b] = b
for c in b.get_children():
if seen.has_key(c):
if c in seen:
continue
order = order + dfs_postorder(c, seen)
order.append(b)
@ -406,7 +406,7 @@ class PyFlowGraph(FlowGraph):
seen = {}
def max_depth(b, d):
if seen.has_key(b):
if b in seen:
return d
seen[b] = 1
d = d + depth[b]
@ -482,7 +482,7 @@ class PyFlowGraph(FlowGraph):
for name in self.cellvars:
cells[name] = 1
self.cellvars = [name for name in self.varnames
if cells.has_key(name)]
if name in cells]
for name in self.cellvars:
del cells[name]
self.cellvars = self.cellvars + cells.keys()