mirror of
https://github.com/python/cpython.git
synced 2025-07-30 06:34:15 +00:00
#4578: fix has_key() usage in compiler package.
This commit is contained in:
parent
cbc1ed5e28
commit
2d2fe572a4
5 changed files with 16 additions and 18 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue