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

Unified Diff: third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/base.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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/base.py
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/base.py b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/base.py
index c85cd20d6b4840ffb632723b4d09c78de6bb11b6..93686ffba27320f57f4e8f133bb4dfa7bf186db5 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/base.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/base.py
@@ -412,8 +412,8 @@ class Port(object):
"""Checks whether we can use the PrettyPatch ruby script."""
try:
_ = self._executive.run_command(['ruby', '--version'])
- except OSError as e:
- if e.errno in [errno.ENOENT, errno.EACCES, errno.ECHILD]:
+ except OSError as error:
+ if error.errno in [errno.ENOENT, errno.EACCES, errno.ECHILD]:
if more_logging:
_log.warning("Ruby is not installed; can't generate pretty patches.")
_log.warning('')
@@ -511,8 +511,8 @@ class Port(object):
result = self._filesystem.read_binary_file(native_diff_filename)
else:
err_str = "Image diff returned an exit code of %s. See http://crbug.com/278596" % exit_code
- except OSError as e:
- err_str = 'error running image diff: %s' % str(e)
+ except OSError as error:
+ err_str = 'error running image diff: %s' % error
finally:
self._filesystem.rmtree(str(tempdir))
@@ -1452,14 +1452,14 @@ class Port(object):
try:
# It's possible to raise a ScriptError we pass wdiff invalid paths.
return self._run_wdiff(actual_filename, expected_filename)
- except OSError as e:
- if e.errno in [errno.ENOENT, errno.EACCES, errno.ECHILD]:
+ except OSError as error:
+ if error.errno in (errno.ENOENT, errno.EACCES, errno.ECHILD):
# Silently ignore cases where wdiff is missing.
self._wdiff_available = False
return ""
raise
- except ScriptError as e:
- _log.error("Failed to run wdiff: %s", e)
+ except ScriptError as error:
+ _log.error("Failed to run wdiff: %s", error)
self._wdiff_available = False
return self._wdiff_error_html
@@ -1477,16 +1477,16 @@ class Port(object):
# Diffs are treated as binary (we pass decode_output=False) as they
# may contain multiple files of conflicting encodings.
return self._executive.run_command(command, decode_output=False)
- except OSError as e:
+ except OSError as error:
# If the system is missing ruby log the error and stop trying.
self._pretty_patch_available = False
- _log.error("Failed to run PrettyPatch (%s): %s", command, e)
+ _log.error("Failed to run PrettyPatch (%s): %s", command, error)
return self._pretty_patch_error_html
- except ScriptError as e:
+ except ScriptError as error:
# If ruby failed to run for some reason, log the command
# output and stop trying.
self._pretty_patch_available = False
- _log.error("Failed to run PrettyPatch (%s):\n%s", command, e.message_with_output())
+ _log.error("Failed to run PrettyPatch (%s):\n%s", command, error.message_with_output())
return self._pretty_patch_error_html
def default_configuration(self):
@@ -1646,8 +1646,8 @@ class Port(object):
try:
test_suite_json = json.loads(self._filesystem.read_text_file(path_to_virtual_test_suites))
self._virtual_test_suites = [VirtualTestSuite(**d) for d in test_suite_json]
- except ValueError as e:
- raise ValueError("LayoutTests/VirtualTestSuites is not a valid JSON file: %s" % str(e))
+ except ValueError as error:
+ raise ValueError("LayoutTests/VirtualTestSuites is not a valid JSON file: %s" % error)
return self._virtual_test_suites
def _all_virtual_tests(self, suites):

Powered by Google App Engine
This is Rietveld 408576698