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.

git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@251977 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Zachary Turner 2015-11-03 21:01:45 +00:00
Родитель 5f1df179f9
Коммит ebca07e77d
2 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -510,7 +510,7 @@ class TestCase(unittest.TestCase):
excName = excClass.__name__
else:
excName = str(excClass)
raise self.failureException, "%s not raised" % excName
raise self.failureException("%s not raised" % excName)
def _getAssertEqualityFunc(self, first, second):
"""Get a detailed comparison function for the types of the two args.
@ -1028,7 +1028,7 @@ class TestCase(unittest.TestCase):
excName = expected_exception.__name__
else:
excName = str(expected_exception)
raise self.failureException, "%s not raised" % excName
raise self.failureException("%s not raised" % excName)
def assertRegexpMatches(self, text, expected_regexp, msg=None):

Просмотреть файл

@ -234,7 +234,7 @@ def sync_configured_sources(options, configuration, default_excludes):
if len(transfer_specs) > 0:
transfer_agent.transfer(transfer_specs, options.dry_run)
else:
raise "nothing to transfer, bad configuration?"
raise Exception("nothing to transfer, bad configuration?")
def main():