Title: [91091] trunk/Tools
Revision
91091
Author
[email protected]
Date
2011-07-15 12:29:43 -0700 (Fri, 15 Jul 2011)

Log 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.

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (91090 => 91091)


--- trunk/Tools/ChangeLog	2011-07-15 19:27:30 UTC (rev 91090)
+++ trunk/Tools/ChangeLog	2011-07-15 19:29:43 UTC (rev 91091)
@@ -1,3 +1,12 @@
+2011-07-15  Dimitri Glazkov  <[email protected]>
+
+        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.
+
 2011-07-15  Martin Robinson  <[email protected]>
 
         Build fixes for WebKit2. Ensure that all generated sources are

Modified: trunk/Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py (91090 => 91091)


--- trunk/Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py	2011-07-15 19:27:30 UTC (rev 91090)
+++ trunk/Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py	2011-07-15 19:29:43 UTC (rev 91091)
@@ -639,9 +639,7 @@
     def _report_errors(self):
         errors = []
         warnings = []
-        lineno = 0
-        for expectation in self._expectations:
-            lineno += 1
+        for lineno, expectation in enumerate(self._expectations, start=1):
             for error in expectation.errors:
                 errors.append("Line:%s %s %s" % (lineno, error, expectation.name if expectation.expectations else expectation.comment))
             for warning in expectation.warnings:
@@ -695,9 +693,7 @@
     def _add_expectations(self, expectation_list, overrides_allowed):
         matcher = ModifierMatcher(self._test_config)
 
-        lineno = 0
-        for expectation in expectation_list:
-            lineno += 1
+        for lineno, expectation in enumerate(expectation_list, start=1):
             expectations = expectation.expectations
 
             if not expectation.expectations:
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to