OSDN Git Service

[utils] Use operator "in" instead of bound function "has_key"
authorRoger Ferrer Ibanez <rofirrim@gmail.com>
Fri, 7 Dec 2018 09:49:21 +0000 (09:49 +0000)
committerRoger Ferrer Ibanez <rofirrim@gmail.com>
Fri, 7 Dec 2018 09:49:21 +0000 (09:49 +0000)
has_key has been removed in Python 3. The in comparison operator can be used
instead.

Differential Revision: https://reviews.llvm.org/D55310

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@348576 91177308-0d34-0410-b5e6-96231b3b80d8

utils/UpdateTestChecks/common.py

index daea395..ed591ae 100644 (file)
@@ -104,7 +104,7 @@ def build_function_body_dictionary(function_re, scrubber, scrubber_args, raw_too
     body = m.group('body')
     scrubbed_body = do_scrub(body, scrubber, scrubber_args, extra = False)
     scrubbed_extra = do_scrub(body, scrubber, scrubber_args, extra = True)
-    if m.groupdict().has_key('analysis'):
+    if 'analysis' in m.groupdict():
       analysis = m.group('analysis')
       if analysis.lower() != 'cost model analysis':
         print('WARNING: Unsupported analysis mode: %r!' % (analysis,), file=sys.stderr)