From 5cd4248672e5cd62cfec4753bd6d6ce666694f1f Mon Sep 17 00:00:00 2001 From: Andreas Sandberg Date: Fri, 25 Jan 2019 12:12:38 +0000 Subject: python: Replace dict.has_key with 'key in dict' Python 3 has removed dict.has_key in favour of 'key in dict'. Change-Id: I9852a5f57d672bea815308eb647a0ce45624fad5 Signed-off-by: Andreas Sandberg Reviewed-on: https://gem5-review.googlesource.com/c/15987 Reviewed-by: Giacomo Travaglini --- src/arch/isa_parser.py | 2 +- src/arch/x86/isa/macroop.isa | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/arch') diff --git a/src/arch/isa_parser.py b/src/arch/isa_parser.py index 16004c009..48bc23fa3 100755 --- a/src/arch/isa_parser.py +++ b/src/arch/isa_parser.py @@ -142,7 +142,7 @@ class Template(object): del myDict['snippets'] snippetLabels = [l for l in labelRE.findall(template) - if d.snippets.has_key(l)] + if l in d.snippets] snippets = dict([(s, self.parser.mungeSnippet(d.snippets[s])) for s in snippetLabels]) diff --git a/src/arch/x86/isa/macroop.isa b/src/arch/x86/isa/macroop.isa index 33e559c11..7d729618a 100644 --- a/src/arch/x86/isa/macroop.isa +++ b/src/arch/x86/isa/macroop.isa @@ -333,7 +333,7 @@ let {{ noModRMString = "env.setSeg(machInst);\n" def genMacroop(Name, env): blocks = OutputBlocks() - if not macroopDict.has_key(Name): + if not Name in macroopDict: raise Exception, "Unrecognized instruction: %s" % Name macroop = macroopDict[Name] if not macroop.declared: -- cgit v1.2.3