Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Side by Side Diff: third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/lint_test_expectations.py

Issue 2580293002: Style change: Rename error variables "e" -> "error" (Closed)
Patch Set: Rebase and fix formatter unittest. Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 # Copyright (C) 2012 Google Inc. All rights reserved. 1 # Copyright (C) 2012 Google Inc. All rights reserved.
2 # 2 #
3 # Redistribution and use in source and binary forms, with or without 3 # Redistribution and use in source and binary forms, with or without
4 # modification, are permitted provided that the following conditions are 4 # modification, are permitted provided that the following conditions are
5 # met: 5 # met:
6 # 6 #
7 # * Redistributions of source code must retain the above copyright 7 # * Redistributions of source code must retain the above copyright
8 # notice, this list of conditions and the following disclaimer. 8 # notice, this list of conditions and the following disclaimer.
9 # * Redistributions in binary form must reproduce the above 9 # * Redistributions in binary form must reproduce the above
10 # copyright notice, this list of conditions and the following disclaimer 10 # copyright notice, this list of conditions and the following disclaimer
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 expectations_dict = port_to_lint.all_expectations_dict() 56 expectations_dict = port_to_lint.all_expectations_dict()
57 57
58 for expectations_file in expectations_dict.keys(): 58 for expectations_file in expectations_dict.keys():
59 if expectations_file in files_linted: 59 if expectations_file in files_linted:
60 continue 60 continue
61 61
62 try: 62 try:
63 test_expectations.TestExpectations(port_to_lint, 63 test_expectations.TestExpectations(port_to_lint,
64 expectations_dict={expectatio ns_file: expectations_dict[expectations_file]}, 64 expectations_dict={expectatio ns_file: expectations_dict[expectations_file]},
65 is_lint_mode=True) 65 is_lint_mode=True)
66 except test_expectations.ParseError as e: 66 except test_expectations.ParseError as error:
67 _log.error('') 67 _log.error('')
68 for warning in e.warnings: 68 for warning in error.warnings:
69 _log.error(warning) 69 _log.error(warning)
70 failures.append('%s: %s' % (expectations_file, warning)) 70 failures.append('%s: %s' % (expectations_file, warning))
71 _log.error('') 71 _log.error('')
72 files_linted.add(expectations_file) 72 files_linted.add(expectations_file)
73 return failures 73 return failures
74 74
75 75
76 def check_virtual_test_suites(host, options): 76 def check_virtual_test_suites(host, options):
77 port = host.port_factory.get(options=options) 77 port = host.port_factory.get(options=options)
78 fs = host.filesystem 78 fs = host.filesystem
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 # debugging test failures. 136 # debugging test failures.
137 from webkitpy.common.host_mock import MockHost 137 from webkitpy.common.host_mock import MockHost
138 host = MockHost() 138 host = MockHost()
139 else: 139 else:
140 host = Host() 140 host = Host()
141 141
142 try: 142 try:
143 exit_status = run_checks(host, options, stderr) 143 exit_status = run_checks(host, options, stderr)
144 except KeyboardInterrupt: 144 except KeyboardInterrupt:
145 exit_status = INTERRUPTED_EXIT_STATUS 145 exit_status = INTERRUPTED_EXIT_STATUS
146 except Exception as e: 146 except Exception as error: # pylint: disable=broad-except
147 print >> stderr, '\n%s raised: %s' % (e.__class__.__name__, str(e)) 147 print >> stderr, '\n%s raised: %s' % (error.__class__.__name__, error)
148 traceback.print_exc(file=stderr) 148 traceback.print_exc(file=stderr)
149 exit_status = EXCEPTIONAL_EXIT_STATUS 149 exit_status = EXCEPTIONAL_EXIT_STATUS
150 150
151 return exit_status 151 return exit_status
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698