From 3606a49c7338fd6b0bf96280bfd1ace001f8f24e Mon Sep 17 00:00:00 2001 From: Joe Guo Date: Mon, 30 Jul 2018 16:43:51 +1200 Subject: PEP8: fix W601: .has_key() is deprecated, use 'in' Signed-off-by: Joe Guo Reviewed-by: Andrew Bartlett Reviewed-by: Douglas Bagnall --- source4/script/depfilter.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source4') diff --git a/source4/script/depfilter.py b/source4/script/depfilter.py index a82dffc1746..c74298dd8d3 100755 --- a/source4/script/depfilter.py +++ b/source4/script/depfilter.py @@ -24,7 +24,7 @@ graph = {} for arc in lines[1:-1]: match = sre.search('"(.*)" -> "(.*)"', arc) n1, n2 = match.group(1), match.group(2) - if not graph.has_key(n1): + if n1 not in graph: graph[n1] = [] graph[n1].append(n2) @@ -33,7 +33,7 @@ for arc in lines[1:-1]: subgraph = {} def add_deps(node): - if graph.has_key(node) and not subgraph.has_key(node): + if node in graph and node not in subgraph: subgraph[node] = graph[node] for n in graph[node]: add_deps(n) -- cgit v1.2.1