Bug 1344858 - Enable flake8 rule W601: ".has_key() is deprecated, use 'in'". r=Dexter
authorpgadige <poojagadige@gmail.com>
Wed, 12 Apr 2017 23:06:29 +0530
changeset 352870 ee2cfbed2e29
parent 352869 7971ea016601
child 352871 bb530cfdb4b1
push id31652
push userkwierso@gmail.com
push dateThu, 13 Apr 2017 20:03:53 +0000
treeherdermozilla-central@3243c8fc3ce7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersDexter
bugs1344858
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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
@@ -532,17 +532,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: