Skip to content

Commit 549ab04

Browse files
[python] Modernize "except" usage for python3 compatibility
https://bugs.webkit.org/show_bug.cgi?id=180612 Reviewed by Michael Catanzaro. Source/JavaScriptCore: * inspector/scripts/generate-inspector-protocol-bindings.py: Tools: * BuildSlaveSupport/build.webkit.org-config/committer_auth.py: (CommitterAuth.auth_json): (CommitterAuth.authenticate): (CommitterAuth.is_webkit_committer): (CommitterAuth.is_webkit_trac_user): * BuildSlaveSupport/wait-for-SVN-server.py: (getLatestSVNRevision): * QueueStatusServer/handlers/updatebase.py: (UpdateBase._int_from_request): * Scripts/webkitpy/bindings/main.py: (BindingsTests.generate_from_idl): (BindingsTests.generate_supplemental_dependency): (BindingsTests.detect_changes): * Scripts/webkitpy/codegen/main.py: (BuiltinsGeneratorTests.generate_from_js_builtins): (BuiltinsGeneratorTests.detect_changes): * Scripts/webkitpy/common/checkout/changelog.py: (ChangeLog.parse_latest_entry_from_file): * Scripts/webkitpy/common/checkout/checkout.py: (Checkout.bug_id_for_this_commit): * Scripts/webkitpy/common/checkout/scm/git.py: (Git.in_working_directory): (Git.clone): (Git._string_to_int_or_none): (Git._commit_on_branch): * Scripts/webkitpy/common/checkout/scm/svn.py: (SVN.revisions_changing_file): * Scripts/webkitpy/common/config/committers.py: (CommitterList.load_json): * Scripts/webkitpy/common/message_pool.py: (_Worker.run): * Scripts/webkitpy/common/net/buildbot/buildbot.py: (Builder.force_build.predicate): (Builder._fetch_revision_to_build_map): (BuildBot._fetch_build_dictionary): * Scripts/webkitpy/common/net/credentials.py: (Credentials._credentials_from_git): * Scripts/webkitpy/common/net/networktransaction.py: (NetworkTransaction.run): * Scripts/webkitpy/common/net/networktransaction_unittest.py: (NetworkTransactionTest.test_exception): (NetworkTransactionTest.test_timeout): * Scripts/webkitpy/common/net/statusserver.py: (StatusServer._fetch_url): * Scripts/webkitpy/common/net/unittestresults.py: (UnitTestResults.results_from_string): * Scripts/webkitpy/common/prettypatch.py: (PrettyPatch.check_pretty_patch): (PrettyPatch.pretty_patch_text): * Scripts/webkitpy/common/prettypatch_unittest.py: (PrettyPatchTest.check_ruby): * Scripts/webkitpy/common/system/autoinstall.py: (AutoInstaller._extract_tar): (AutoInstaller._unzip): (AutoInstaller._replace_domain_with_next_mirror): (AutoInstaller._download_to_stream): (AutoInstaller.install): * Scripts/webkitpy/common/system/crashlogs.py: (CrashLogs._find_newest_log_darwin): (CrashLogs._find_newest_log_win): (CrashLogs._find_all_logs_darwin): * Scripts/webkitpy/common/system/executive.py: (Executive.kill_process): (Executive.running_pids): * Scripts/webkitpy/common/system/filesystem.py: (FileSystem.maybe_make_directory): (FileSystem.remove): * Scripts/webkitpy/common/system/user.py: (User._wait_on_list_response): (User.edit): (User.page): (User.can_open_url): * Scripts/webkitpy/common/system/workspace.py: (Workspace.create_zip): * Scripts/webkitpy/common/watchlist/watchlistparser.py: (WatchListParser._parse_definition_section): * Scripts/webkitpy/common/webkitunittest.py: (TestCase._assertRaisesRegexp): * Scripts/webkitpy/inspector/main.py: (InspectorGeneratorTests.generate_from_json): (InspectorGeneratorTests.detect_changes): * Scripts/webkitpy/layout_tests/controllers/layout_test_finder.py: (LayoutTestFinder._read_test_names_from_file): * Scripts/webkitpy/layout_tests/controllers/layout_test_runner.py: (LayoutTestRunner.run_tests): * Scripts/webkitpy/layout_tests/controllers/manager.py: (Manager.upload_results): * Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py: (JSONResultsGenerator.upload_json_files): (JSONResultsGenerator._get_archived_json_results): * Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py: (MiscTests.test_parse_warning): (SemanticTests.test_bad_bugid): * Scripts/webkitpy/layout_tests/models/test_run_results.py: (summarize_results): * Scripts/webkitpy/layout_tests/run_webkit_tests.py: (main): * Scripts/webkitpy/layout_tests/servers/http_server.py: (Lighttpd._remove_stale_logs): * Scripts/webkitpy/layout_tests/servers/http_server_base.py: (HttpServerBase._is_running_on_port): (HttpServerBase._check_that_all_ports_are_available): * Scripts/webkitpy/layout_tests/servers/http_server_integrationtest.py: (BaseTest.assert_servers_are_down): (BaseTest.assert_servers_are_up): (BaseTest.integration_test_server__fails): (BaseTest.maybe_make_dir): * Scripts/webkitpy/layout_tests/servers/run_webkit_httpd.py: (run_server): * Scripts/webkitpy/layout_tests/servers/web_platform_test_launcher.py: * Scripts/webkitpy/layout_tests/servers/websocket_server.py: (PyWebSocket.is_running): (PyWebSocket._remove_stale_logs): * Scripts/webkitpy/performance_tests/perftestsrunner.py: (_merge_slave_config_json): (_merge_outputs_if_needed): (_upload_json): * Scripts/webkitpy/port/base.py: (Port._build_driver): (Port._build_image_diff): (Port._symbols_string): * Scripts/webkitpy/port/leakdetector.py: (LeakDetector.count_total_bytes_and_unique_leaks): (LeakDetector.check_for_leaks): * Scripts/webkitpy/port/leakdetector_valgrind.py: (LeakDetectorValgrind._parse_leaks_output): * Scripts/webkitpy/port/mac.py: (MacPort.reset_preferences): (MacPort.stop_helper): * Scripts/webkitpy/port/port_testcase.py: (PortTestCase.assert_servers_are_down): (PortTestCase.assert_servers_are_up): (PortTestCase.integration_test_http_server__fails): (PortTestCase.integration_test_websocket_server__fails): * Scripts/webkitpy/port/server_process.py: (ServerProcess.write): (ServerProcess._wait_for_data_and_update_buffers_using_select): (ServerProcess._non_blocking_read_win32): * Scripts/webkitpy/port/win.py: (WinPort._runtime_feature_list): * Scripts/webkitpy/port/xvfbdriver.py: (XvfbDriver._xvfb_read_display_id): * Scripts/webkitpy/style/checkers/jsonchecker.py: (JSONChecker.check): * Scripts/webkitpy/style/checkers/xml.py: (XMLChecker.check): * Scripts/webkitpy/style/filereader.py: (TextFileReader.process_file): * Scripts/webkitpy/style/filereader_unittest.py: (TextFileReaderTest.test_process_file__does_not_exist): * Scripts/webkitpy/style/optparser.py: (ArgumentParser.parse): * Scripts/webkitpy/tool/bot/irc_command.py: (CreateBug.execute): (Rollout.execute): * Scripts/webkitpy/tool/bot/ircbot.py: (IRCBot.process_message): * Scripts/webkitpy/tool/bot/layouttestresultsreader.py: (LayoutTestResultsReader._read_file_contents): * Scripts/webkitpy/tool/bot/patchanalysistask.py: (PatchAnalysisTask._run_command): * Scripts/webkitpy/tool/bot/queueengine.py: (QueueEngine.run): * Scripts/webkitpy/tool/commands/abstractsequencedcommand.py: (AbstractSequencedCommand.execute): * Scripts/webkitpy/tool/commands/download.py: (AbstractPatchSequencingCommand._prepare_to_process): * Scripts/webkitpy/tool/commands/earlywarningsystem.py: (AbstractEarlyWarningSystem.review_patch): * Scripts/webkitpy/tool/commands/queries.py: (FailureReason._blame_line_for_revision): * Scripts/webkitpy/tool/commands/queues.py: (AbstractQueue._cc_watchers): (AbstractQueue.run_webkit_patch): (CommitQueue.process_work_item): (StyleQueue.review_patch): * Scripts/webkitpy/tool/commands/rebaseline.py: (AbstractParallelRebaselineCommand._run_webkit_patch): * Scripts/webkitpy/tool/commands/stepsequence.py: (StepSequence.run_and_handle_errors): * Scripts/webkitpy/tool/commands/suggestnominations.py: (SuggestNominations._count_recent_patches): * Scripts/webkitpy/tool/multicommandtool.py: (MultiCommandTool.main): * Scripts/webkitpy/tool/servers/rebaselineserver.py: (_rebaseline_test): (_move_test_baselines): * Scripts/webkitpy/tool/steps/addsvnmimetypeforpng_unittest.py: (AddSvnMimetypeForPngTest.test_run): * Scripts/webkitpy/tool/steps/checkstyle.py: (CheckStyle.run): * Scripts/webkitpy/tool/steps/commit.py: (Commit._check_test_expectations): (Commit.run): * Scripts/webkitpy/tool/steps/confirmdiff.py: (ConfirmDiff._show_pretty_diff): * Scripts/webkitpy/tool/steps/haslanded.py: (HasLanded.diff_diff): * Scripts/webkitpy/tool/steps/preparechangelog.py: (PrepareChangeLog.run): * Scripts/webkitpy/tool/steps/promptforbugortitle.py: (PromptForBugOrTitle.run): * Scripts/webkitpy/tool/steps/sortxcodeprojectfiles.py: (SortXcodeProjectFiles.run): * Scripts/webkitpy/webdriver_tests/webdriver_w3c_web_server.py: (WebDriverW3CWebServer._wait_for_server.check_port): * TestResultServer/model/datastorefile.py: (DataStoreFile.save_data): * jhbuild/jhbuildutils.py: (enter_jhbuild_environment_if_available): git-svn-id: http://svn.webkit.org/repository/webkit/trunk@225733 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent adf5b81 commit 549ab04

File tree

84 files changed

+382
-155
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+382
-155
lines changed

Source/JavaScriptCore/ChangeLog

+9
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
2017-12-10 Konstantin Tokarev <[email protected]>
2+
3+
[python] Modernize "except" usage for python3 compatibility
4+
https://bugs.webkit.org/show_bug.cgi?id=180612
5+
6+
Reviewed by Michael Catanzaro.
7+
8+
* inspector/scripts/generate-inspector-protocol-bindings.py:
9+
110
2017-12-05 Filip Pizlo <[email protected]>
211

312
InferredType should not use UnconditionalFinalizer

Source/JavaScriptCore/inspector/scripts/generate-inspector-protocol-bindings.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848

4949
# When copying generator files to JavaScriptCore's private headers on Mac,
5050
# the codegen/ module directory is flattened. So, import directly.
51-
except ImportError, e:
51+
except ImportError as e:
5252
# log.error(e) # Uncomment this to debug early import errors.
5353
import models
5454
from models import *

Tools/BuildSlaveSupport/build.webkit.org-config/committer_auth.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ def auth_json(self):
4444
try:
4545
with self.open_auth_json_file() as f:
4646
return json.load(f)
47-
except IOError, e:
47+
except IOError as e:
4848
raise Error('Error opening auth.json file: {0}'.format(e.strerror))
49-
except ValueError, e:
49+
except ValueError as e:
5050
raise Error('Error parsing auth.json file: {0}'.format(e.message))
5151

5252
def auth_json_filename(self):
@@ -55,7 +55,7 @@ def auth_json_filename(self):
5555
def authenticate(self, username, password):
5656
try:
5757
return self.is_webkit_committer(username) and self.is_webkit_trac_user(username, password)
58-
except Error, e:
58+
except Error as e:
5959
self.err = e.args[0]
6060
return False
6161

@@ -67,14 +67,14 @@ def is_webkit_committer(self, username):
6767
return True
6868
except ConfigParser.Error:
6969
raise Error('Error parsing WebKit committers file')
70-
except IOError, e:
70+
except IOError as e:
7171
raise Error('Error opening WebKit committers file: {0}'.format(e.strerror))
7272

7373
def is_webkit_trac_user(self, username, password):
7474
try:
7575
with self.open_trac_credentials_file() as f:
7676
htdigest = HTDigestParser(f)
77-
except IOError, e:
77+
except IOError as e:
7878
raise Error('Error opening Trac credentials file: {0}'.format(e.strerror))
7979

8080
if not htdigest.entries():

Tools/BuildSlaveSupport/wait-for-SVN-server.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def getLatestSVNRevision(SVNServer):
3939
doc = xml.dom.minidom.parseString(response)
4040
el = doc.getElementsByTagName("logentry")[0]
4141
return el.getAttribute("revision")
42-
except xml.parsers.expat.ExpatError, e:
42+
except xml.parsers.expat.ExpatError as e:
4343
print("FAILED TO PARSE 'svn log' XML:")
4444
print(str(e))
4545
print("----")

Tools/ChangeLog

+218
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,221 @@
1+
2017-12-10 Konstantin Tokarev <[email protected]>
2+
3+
[python] Modernize "except" usage for python3 compatibility
4+
https://bugs.webkit.org/show_bug.cgi?id=180612
5+
6+
Reviewed by Michael Catanzaro.
7+
8+
* BuildSlaveSupport/build.webkit.org-config/committer_auth.py:
9+
(CommitterAuth.auth_json):
10+
(CommitterAuth.authenticate):
11+
(CommitterAuth.is_webkit_committer):
12+
(CommitterAuth.is_webkit_trac_user):
13+
* BuildSlaveSupport/wait-for-SVN-server.py:
14+
(getLatestSVNRevision):
15+
* QueueStatusServer/handlers/updatebase.py:
16+
(UpdateBase._int_from_request):
17+
* Scripts/webkitpy/bindings/main.py:
18+
(BindingsTests.generate_from_idl):
19+
(BindingsTests.generate_supplemental_dependency):
20+
(BindingsTests.detect_changes):
21+
* Scripts/webkitpy/codegen/main.py:
22+
(BuiltinsGeneratorTests.generate_from_js_builtins):
23+
(BuiltinsGeneratorTests.detect_changes):
24+
* Scripts/webkitpy/common/checkout/changelog.py:
25+
(ChangeLog.parse_latest_entry_from_file):
26+
* Scripts/webkitpy/common/checkout/checkout.py:
27+
(Checkout.bug_id_for_this_commit):
28+
* Scripts/webkitpy/common/checkout/scm/git.py:
29+
(Git.in_working_directory):
30+
(Git.clone):
31+
(Git._string_to_int_or_none):
32+
(Git._commit_on_branch):
33+
* Scripts/webkitpy/common/checkout/scm/svn.py:
34+
(SVN.revisions_changing_file):
35+
* Scripts/webkitpy/common/config/committers.py:
36+
(CommitterList.load_json):
37+
* Scripts/webkitpy/common/message_pool.py:
38+
(_Worker.run):
39+
* Scripts/webkitpy/common/net/buildbot/buildbot.py:
40+
(Builder.force_build.predicate):
41+
(Builder._fetch_revision_to_build_map):
42+
(BuildBot._fetch_build_dictionary):
43+
* Scripts/webkitpy/common/net/credentials.py:
44+
(Credentials._credentials_from_git):
45+
* Scripts/webkitpy/common/net/networktransaction.py:
46+
(NetworkTransaction.run):
47+
* Scripts/webkitpy/common/net/networktransaction_unittest.py:
48+
(NetworkTransactionTest.test_exception):
49+
(NetworkTransactionTest.test_timeout):
50+
* Scripts/webkitpy/common/net/statusserver.py:
51+
(StatusServer._fetch_url):
52+
* Scripts/webkitpy/common/net/unittestresults.py:
53+
(UnitTestResults.results_from_string):
54+
* Scripts/webkitpy/common/prettypatch.py:
55+
(PrettyPatch.check_pretty_patch):
56+
(PrettyPatch.pretty_patch_text):
57+
* Scripts/webkitpy/common/prettypatch_unittest.py:
58+
(PrettyPatchTest.check_ruby):
59+
* Scripts/webkitpy/common/system/autoinstall.py:
60+
(AutoInstaller._extract_tar):
61+
(AutoInstaller._unzip):
62+
(AutoInstaller._replace_domain_with_next_mirror):
63+
(AutoInstaller._download_to_stream):
64+
(AutoInstaller.install):
65+
* Scripts/webkitpy/common/system/crashlogs.py:
66+
(CrashLogs._find_newest_log_darwin):
67+
(CrashLogs._find_newest_log_win):
68+
(CrashLogs._find_all_logs_darwin):
69+
* Scripts/webkitpy/common/system/executive.py:
70+
(Executive.kill_process):
71+
(Executive.running_pids):
72+
* Scripts/webkitpy/common/system/filesystem.py:
73+
(FileSystem.maybe_make_directory):
74+
(FileSystem.remove):
75+
* Scripts/webkitpy/common/system/user.py:
76+
(User._wait_on_list_response):
77+
(User.edit):
78+
(User.page):
79+
(User.can_open_url):
80+
* Scripts/webkitpy/common/system/workspace.py:
81+
(Workspace.create_zip):
82+
* Scripts/webkitpy/common/watchlist/watchlistparser.py:
83+
(WatchListParser._parse_definition_section):
84+
* Scripts/webkitpy/common/webkitunittest.py:
85+
(TestCase._assertRaisesRegexp):
86+
* Scripts/webkitpy/inspector/main.py:
87+
(InspectorGeneratorTests.generate_from_json):
88+
(InspectorGeneratorTests.detect_changes):
89+
* Scripts/webkitpy/layout_tests/controllers/layout_test_finder.py:
90+
(LayoutTestFinder._read_test_names_from_file):
91+
* Scripts/webkitpy/layout_tests/controllers/layout_test_runner.py:
92+
(LayoutTestRunner.run_tests):
93+
* Scripts/webkitpy/layout_tests/controllers/manager.py:
94+
(Manager.upload_results):
95+
* Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py:
96+
(JSONResultsGenerator.upload_json_files):
97+
(JSONResultsGenerator._get_archived_json_results):
98+
* Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py:
99+
(MiscTests.test_parse_warning):
100+
(SemanticTests.test_bad_bugid):
101+
* Scripts/webkitpy/layout_tests/models/test_run_results.py:
102+
(summarize_results):
103+
* Scripts/webkitpy/layout_tests/run_webkit_tests.py:
104+
(main):
105+
* Scripts/webkitpy/layout_tests/servers/http_server.py:
106+
(Lighttpd._remove_stale_logs):
107+
* Scripts/webkitpy/layout_tests/servers/http_server_base.py:
108+
(HttpServerBase._is_running_on_port):
109+
(HttpServerBase._check_that_all_ports_are_available):
110+
* Scripts/webkitpy/layout_tests/servers/http_server_integrationtest.py:
111+
(BaseTest.assert_servers_are_down):
112+
(BaseTest.assert_servers_are_up):
113+
(BaseTest.integration_test_server__fails):
114+
(BaseTest.maybe_make_dir):
115+
* Scripts/webkitpy/layout_tests/servers/run_webkit_httpd.py:
116+
(run_server):
117+
* Scripts/webkitpy/layout_tests/servers/web_platform_test_launcher.py:
118+
* Scripts/webkitpy/layout_tests/servers/websocket_server.py:
119+
(PyWebSocket.is_running):
120+
(PyWebSocket._remove_stale_logs):
121+
* Scripts/webkitpy/performance_tests/perftestsrunner.py:
122+
(_merge_slave_config_json):
123+
(_merge_outputs_if_needed):
124+
(_upload_json):
125+
* Scripts/webkitpy/port/base.py:
126+
(Port._build_driver):
127+
(Port._build_image_diff):
128+
(Port._symbols_string):
129+
* Scripts/webkitpy/port/leakdetector.py:
130+
(LeakDetector.count_total_bytes_and_unique_leaks):
131+
(LeakDetector.check_for_leaks):
132+
* Scripts/webkitpy/port/leakdetector_valgrind.py:
133+
(LeakDetectorValgrind._parse_leaks_output):
134+
* Scripts/webkitpy/port/mac.py:
135+
(MacPort.reset_preferences):
136+
(MacPort.stop_helper):
137+
* Scripts/webkitpy/port/port_testcase.py:
138+
(PortTestCase.assert_servers_are_down):
139+
(PortTestCase.assert_servers_are_up):
140+
(PortTestCase.integration_test_http_server__fails):
141+
(PortTestCase.integration_test_websocket_server__fails):
142+
* Scripts/webkitpy/port/server_process.py:
143+
(ServerProcess.write):
144+
(ServerProcess._wait_for_data_and_update_buffers_using_select):
145+
(ServerProcess._non_blocking_read_win32):
146+
* Scripts/webkitpy/port/win.py:
147+
(WinPort._runtime_feature_list):
148+
* Scripts/webkitpy/port/xvfbdriver.py:
149+
(XvfbDriver._xvfb_read_display_id):
150+
* Scripts/webkitpy/style/checkers/jsonchecker.py:
151+
(JSONChecker.check):
152+
* Scripts/webkitpy/style/checkers/xml.py:
153+
(XMLChecker.check):
154+
* Scripts/webkitpy/style/filereader.py:
155+
(TextFileReader.process_file):
156+
* Scripts/webkitpy/style/filereader_unittest.py:
157+
(TextFileReaderTest.test_process_file__does_not_exist):
158+
* Scripts/webkitpy/style/optparser.py:
159+
(ArgumentParser.parse):
160+
* Scripts/webkitpy/tool/bot/irc_command.py:
161+
(CreateBug.execute):
162+
(Rollout.execute):
163+
* Scripts/webkitpy/tool/bot/ircbot.py:
164+
(IRCBot.process_message):
165+
* Scripts/webkitpy/tool/bot/layouttestresultsreader.py:
166+
(LayoutTestResultsReader._read_file_contents):
167+
* Scripts/webkitpy/tool/bot/patchanalysistask.py:
168+
(PatchAnalysisTask._run_command):
169+
* Scripts/webkitpy/tool/bot/queueengine.py:
170+
(QueueEngine.run):
171+
* Scripts/webkitpy/tool/commands/abstractsequencedcommand.py:
172+
(AbstractSequencedCommand.execute):
173+
* Scripts/webkitpy/tool/commands/download.py:
174+
(AbstractPatchSequencingCommand._prepare_to_process):
175+
* Scripts/webkitpy/tool/commands/earlywarningsystem.py:
176+
(AbstractEarlyWarningSystem.review_patch):
177+
* Scripts/webkitpy/tool/commands/queries.py:
178+
(FailureReason._blame_line_for_revision):
179+
* Scripts/webkitpy/tool/commands/queues.py:
180+
(AbstractQueue._cc_watchers):
181+
(AbstractQueue.run_webkit_patch):
182+
(CommitQueue.process_work_item):
183+
(StyleQueue.review_patch):
184+
* Scripts/webkitpy/tool/commands/rebaseline.py:
185+
(AbstractParallelRebaselineCommand._run_webkit_patch):
186+
* Scripts/webkitpy/tool/commands/stepsequence.py:
187+
(StepSequence.run_and_handle_errors):
188+
* Scripts/webkitpy/tool/commands/suggestnominations.py:
189+
(SuggestNominations._count_recent_patches):
190+
* Scripts/webkitpy/tool/multicommandtool.py:
191+
(MultiCommandTool.main):
192+
* Scripts/webkitpy/tool/servers/rebaselineserver.py:
193+
(_rebaseline_test):
194+
(_move_test_baselines):
195+
* Scripts/webkitpy/tool/steps/addsvnmimetypeforpng_unittest.py:
196+
(AddSvnMimetypeForPngTest.test_run):
197+
* Scripts/webkitpy/tool/steps/checkstyle.py:
198+
(CheckStyle.run):
199+
* Scripts/webkitpy/tool/steps/commit.py:
200+
(Commit._check_test_expectations):
201+
(Commit.run):
202+
* Scripts/webkitpy/tool/steps/confirmdiff.py:
203+
(ConfirmDiff._show_pretty_diff):
204+
* Scripts/webkitpy/tool/steps/haslanded.py:
205+
(HasLanded.diff_diff):
206+
* Scripts/webkitpy/tool/steps/preparechangelog.py:
207+
(PrepareChangeLog.run):
208+
* Scripts/webkitpy/tool/steps/promptforbugortitle.py:
209+
(PromptForBugOrTitle.run):
210+
* Scripts/webkitpy/tool/steps/sortxcodeprojectfiles.py:
211+
(SortXcodeProjectFiles.run):
212+
* Scripts/webkitpy/webdriver_tests/webdriver_w3c_web_server.py:
213+
(WebDriverW3CWebServer._wait_for_server.check_port):
214+
* TestResultServer/model/datastorefile.py:
215+
(DataStoreFile.save_data):
216+
* jhbuild/jhbuildutils.py:
217+
(enter_jhbuild_environment_if_available):
218+
1219
2017-12-09 Yusuke Suzuki <[email protected]>
2220

3221
Fix WTF::Hasher tuple expansion with variadic args

Tools/QueueStatusServer/handlers/updatebase.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,6 @@ def _int_from_request(self, name):
3636
try:
3737
int_value = int(string_value)
3838
return int_value
39-
except ValueError, TypeError:
39+
except ValueError as TypeError:
4040
pass
4141
return None

Tools/Scripts/webkitpy/bindings/main.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def generate_from_idl(self, generator, idl_file, output_directory, supplemental_
6565
output = self.executive.run_command(cmd)
6666
if output:
6767
print(output)
68-
except ScriptError, e:
68+
except ScriptError as e:
6969
print(e.output)
7070
exit_code = e.exit_code
7171
return exit_code
@@ -95,7 +95,7 @@ def generate_supplemental_dependency(self, input_directory, supplemental_depende
9595
output = self.executive.run_command(cmd)
9696
if output:
9797
print(output)
98-
except ScriptError, e:
98+
except ScriptError as e:
9999
print(e.output)
100100
exit_code = e.exit_code
101101
os.remove(idl_files_list[1])
@@ -113,7 +113,7 @@ def detect_changes(self, generator, work_directory, reference_directory):
113113
exit_code = 0
114114
try:
115115
output = self.executive.run_command(cmd)
116-
except ScriptError, e:
116+
except ScriptError as e:
117117
output = e.output
118118
exit_code = e.exit_code
119119

Tools/Scripts/webkitpy/codegen/main.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def generate_from_js_builtins(self, builtins_files, output_directory, framework_
5757
stderr_output = self.executive.run_command(cmd)
5858
if stderr_output:
5959
self.write_error_file(framework_name + "JSBuiltins.h-error" if generate_wrappers else builtins_files[0], output_directory, stderr_output)
60-
except ScriptError, e:
60+
except ScriptError as e:
6161
print(e.output)
6262
exit_code = e.exit_code
6363
return exit_code
@@ -80,7 +80,7 @@ def detect_changes(self, work_directory, reference_directory):
8080
exit_code = 0
8181
try:
8282
output = self.executive.run_command(cmd)
83-
except ScriptError, e:
83+
except ScriptError as e:
8484
output = e.output
8585
exit_code = e.exit_code
8686

Tools/Scripts/webkitpy/common/checkout/changelog.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ def __init__(self, path, filesystem=None):
308308
def parse_latest_entry_from_file(cls, changelog_file):
309309
try:
310310
return next(cls.parse_entries_from_file(changelog_file))
311-
except StopIteration, e:
311+
except StopIteration as e:
312312
return None
313313

314314
svn_blame_regexp = re.compile(r'^(\s*(?P<revision>\d+) [^ ]+)\s*(?P<line>.*?\n)')

Tools/Scripts/webkitpy/common/checkout/checkout.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ def suggested_reviewers(self, git_commit, changed_files=None):
149149
def bug_id_for_this_commit(self, git_commit, changed_files=None):
150150
try:
151151
return parse_bug_id_from_changelog(self.commit_message_for_this_commit(git_commit, changed_files).message())
152-
except ScriptError, e:
152+
except ScriptError as e:
153153
pass # We might not have ChangeLogs.
154154

155155
def apply_patch(self, patch):

Tools/Scripts/webkitpy/common/checkout/scm/git.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def in_working_directory(cls, path, executive=None):
111111
try:
112112
executive = executive or Executive()
113113
return executive.run_command([cls.executable_name, 'rev-parse', '--is-inside-work-tree'], cwd=path, error_handler=Executive.ignore_error).rstrip() == "true"
114-
except OSError, e:
114+
except OSError as e:
115115
# The Windows bots seem to through a WindowsError when git isn't installed.
116116
return False
117117

@@ -120,7 +120,7 @@ def clone(cls, url, directory, executive=None):
120120
try:
121121
executive = executive or Executive()
122122
return executive.run_command([cls.executable_name, 'clone', '-v', url, directory], error_handler=Executive.ignore_error)
123-
except OSError, e:
123+
except OSError as e:
124124
return False
125125

126126
def find_checkout_root(self, path):
@@ -359,7 +359,7 @@ def _run_git_svn_find_rev(self, revision_or_treeish, branch=None):
359359
def _string_to_int_or_none(self, string):
360360
try:
361361
return int(string)
362-
except ValueError, e:
362+
except ValueError as e:
363363
return None
364364

365365
@memoized
@@ -472,7 +472,7 @@ def _commit_on_branch(self, message, git_commit, username=None, password=None):
472472

473473
self._run_git(['commit', '-m', message])
474474
output = self.push_local_commits_to_server(username=username, password=password)
475-
except Exception, e:
475+
except Exception as e:
476476
_log.warning("COMMIT FAILED: " + str(e))
477477
output = "Commit failed."
478478
commit_succeeded = False

0 commit comments

Comments
 (0)