Skip to content

Commit 9618980

Browse files
author
Zachary Turner
committed
Python 3: Modernize exception raising syntax.
Old-style: `raise foo, bar` New-style: `raise foo(bar)` These two statements are equivalent, but the former is an error in Python 3. llvm-svn: 251977
1 parent c8a7913 commit 9618980

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lldb/third_party/Python/module/unittest2/unittest2/case.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ def assertRaises(self, excClass, callableObj=None, *args, **kwargs):
510510
excName = excClass.__name__
511511
else:
512512
excName = str(excClass)
513-
raise self.failureException, "%s not raised" % excName
513+
raise self.failureException("%s not raised" % excName)
514514

515515
def _getAssertEqualityFunc(self, first, second):
516516
"""Get a detailed comparison function for the types of the two args.
@@ -1028,7 +1028,7 @@ def assertRaisesRegexp(self, expected_exception, expected_regexp,
10281028
excName = expected_exception.__name__
10291029
else:
10301030
excName = str(expected_exception)
1031-
raise self.failureException, "%s not raised" % excName
1031+
raise self.failureException("%s not raised" % excName)
10321032

10331033

10341034
def assertRegexpMatches(self, text, expected_regexp, msg=None):

lldb/utils/sync-source/syncsource.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ def sync_configured_sources(options, configuration, default_excludes):
234234
if len(transfer_specs) > 0:
235235
transfer_agent.transfer(transfer_specs, options.dry_run)
236236
else:
237-
raise "nothing to transfer, bad configuration?"
237+
raise Exception("nothing to transfer, bad configuration?")
238238

239239

240240
def main():

0 commit comments

Comments
 (0)