[PATCH] D55310: [utils] Use operator "in" instead of bound function "has_key"

Roger Ferrer Ibanez via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 4 22:45:44 PST 2018


rogfer01 created this revision.
rogfer01 added a reviewer: RKSimon.
Herald added a subscriber: llvm-commits.

`has_key` has been removed in Python 3. The `in` comparison operator can be used instead.


Repository:
  rL LLVM

https://reviews.llvm.org/D55310

Files:
  utils/UpdateTestChecks/common.py


Index: utils/UpdateTestChecks/common.py
===================================================================
--- utils/UpdateTestChecks/common.py
+++ utils/UpdateTestChecks/common.py
@@ -104,7 +104,7 @@
     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)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D55310.176764.patch
Type: text/x-patch
Size: 642 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181205/9fa6ab3e/attachment.bin>


More information about the llvm-commits mailing list