From d7a4228ebb0150e4c97a19077f3fac81d843e2c3 Mon Sep 17 00:00:00 2001 From: Eduardo Habkost Date: Fri, 8 Jun 2018 09:29:46 -0300 Subject: python: futurize -f lib2to3.fixes.fix_has_key MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change "dict.has_key(key)" to "key in dict" This is necessary for Python 3 compatibility. Done using: $ py=$( (g grep -l -E '^#!.*python';find -name '*.py' -printf '%P\n';) | \ sort -u | grep -v README.sh4) $ futurize -w -f lib2to3.fixes.fix_has_key $py Reviewed-by: Stefan Hajnoczi Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Eduardo Habkost Message-Id: <20180608122952.2009-5-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost --- scripts/qmp/qom-fuse | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts/qmp/qom-fuse') diff --git a/scripts/qmp/qom-fuse b/scripts/qmp/qom-fuse index b75aa72767..b00cb0a0af 100755 --- a/scripts/qmp/qom-fuse +++ b/scripts/qmp/qom-fuse @@ -29,7 +29,7 @@ class QOMFS(Fuse): self.ino_count = 1 def get_ino(self, path): - if self.ino_map.has_key(path): + if path in self.ino_map: return self.ino_map[path] self.ino_map[path] = self.ino_count self.ino_count += 1 -- cgit v1.2.3