Changeset 91091 in webkit


Ignore:
Timestamp:
Jul 15, 2011 12:29:43 PM (13 years ago)
Author:
Dimitri Glazkov
Message:

Switch to use Python enumerate function to enumerate line numbers.
https://bugs.webkit.org/show_bug.cgi?id=64602

Reviewed by Adam Barth.

  • Scripts/webkitpy/layout_tests/models/test_expectations.py: Changed to use enumerate.
Location:
trunk/Tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r91078 r91091  
     12011-07-15  Dimitri Glazkov  <dglazkov@chromium.org>
     2
     3        Switch to use Python enumerate function to enumerate line numbers.
     4        https://bugs.webkit.org/show_bug.cgi?id=64602
     5
     6        Reviewed by Adam Barth.
     7
     8        * Scripts/webkitpy/layout_tests/models/test_expectations.py: Changed to use enumerate.
     9
    1102011-07-15  Martin Robinson  <mrobinson@igalia.com>
    211
  • trunk/Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py

    r91073 r91091  
    640640        errors = []
    641641        warnings = []
    642         lineno = 0
    643         for expectation in self._expectations:
    644             lineno += 1
     642        for lineno, expectation in enumerate(self._expectations, start=1):
    645643            for error in expectation.errors:
    646644                errors.append("Line:%s %s %s" % (lineno, error, expectation.name if expectation.expectations else expectation.comment))
     
    696694        matcher = ModifierMatcher(self._test_config)
    697695
    698         lineno = 0
    699         for expectation in expectation_list:
    700             lineno += 1
     696        for lineno, expectation in enumerate(expectation_list, start=1):
    701697            expectations = expectation.expectations
    702698
Note: See TracChangeset for help on using the changeset viewer.