Issue #16714: use 'raise' exceptions, don't 'throw'.

Patch by Serhiy Storchaka.
This commit is contained in:
Andrew Svetlov 2012-12-18 21:27:16 +02:00
commit a191959849
42 changed files with 64 additions and 64 deletions

View file

@ -202,33 +202,33 @@ class StatAttributeTests(unittest.TestCase):
try:
result[200]
self.fail("No exception thrown")
self.fail("No exception raised")
except IndexError:
pass
# Make sure that assignment fails
try:
result.st_mode = 1
self.fail("No exception thrown")
self.fail("No exception raised")
except AttributeError:
pass
try:
result.st_rdev = 1
self.fail("No exception thrown")
self.fail("No exception raised")
except (AttributeError, TypeError):
pass
try:
result.parrot = 1
self.fail("No exception thrown")
self.fail("No exception raised")
except AttributeError:
pass
# Use the stat_result constructor with a too-short tuple.
try:
result2 = os.stat_result((10,))
self.fail("No exception thrown")
self.fail("No exception raised")
except TypeError:
pass
@ -273,20 +273,20 @@ class StatAttributeTests(unittest.TestCase):
# Make sure that assignment really fails
try:
result.f_bfree = 1
self.fail("No exception thrown")
self.fail("No exception raised")
except AttributeError:
pass
try:
result.parrot = 1
self.fail("No exception thrown")
self.fail("No exception raised")
except AttributeError:
pass
# Use the constructor with a too-short tuple.
try:
result2 = os.statvfs_result((10,))
self.fail("No exception thrown")
self.fail("No exception raised")
except TypeError:
pass