Bug 1344858 - Enable flake8 rule W601: ".has_key() is deprecated, use 'in'". r?dexter draft
authorpgadige <poojagadige@gmail.com>
Wed, 12 Apr 2017 23:06:29 +0530
changeset 561473 aa705ae2bdf6aa5dd42b3cede6678d1862bb6730
parent 560921 f40e24f40b4c4556944c762d4764eace261297f5
child 623978 3553a91cec2e01d2a4f02fcdee48d02fb5f430fe
push id53733
push userbmo:poojagadige@gmail.com
push dateWed, 12 Apr 2017 17:37:33 +0000
reviewersdexter
bugs1344858
milestone55.0a1
Bug 1344858 - Enable flake8 rule W601: ".has_key() is deprecated, use 'in'". r?dexter MozReview-Commit-ID: Far2S2TIZyl
toolkit/components/telemetry/.flake8
toolkit/components/telemetry/histogram_tools.py
--- a/toolkit/components/telemetry/.flake8
+++ b/toolkit/components/telemetry/.flake8
@@ -1,5 +1,5 @@
 [flake8]
 # See http://pep8.readthedocs.io/en/latest/intro.html#configuration
-ignore = E121, E123, E126, E129, E133, E226, E241, E242, E704, W503, E402, E501, W601
+ignore = E121, E123, E126, E129, E133, E226, E241, E242, E704, W503, E402, E501
 max-line-length = 99
 filename = *.py, +.lint
--- a/toolkit/components/telemetry/histogram_tools.py
+++ b/toolkit/components/telemetry/histogram_tools.py
@@ -521,17 +521,17 @@ the histograms defined in filenames.
         # OrderedDicts are important, because then the iteration order over
         # the parsed histograms is stable, which makes the insertion into
         # all_histograms stable, which makes ordering in generated files
         # stable, which makes builds more deterministic.
         if not isinstance(histograms, OrderedDict):
             raise BaseException("histogram parser didn't provide an OrderedDict")
 
         for (name, definition) in histograms.iteritems():
-            if all_histograms.has_key(name):
+            if name in all_histograms:
                 raise DefinitionException("duplicate histogram name %s" % name)
             all_histograms[name] = definition
 
     # We require that all USE_COUNTER2_* histograms be defined in a contiguous
     # block.
     use_counter_indices = filter(lambda x: x[1].startswith("USE_COUNTER2_"),
                                  enumerate(all_histograms.iterkeys()))
     if use_counter_indices: