mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Issue #16714: use 'raise' exceptions, don't 'throw'.
Patch by Serhiy Storchaka.
This commit is contained in:
commit
a191959849
42 changed files with 64 additions and 64 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue