mirror of
https://github.com/python/cpython.git
synced 2025-08-03 08:34:29 +00:00
condense with assertRaises
This commit is contained in:
parent
d3243d8db8
commit
50a2252851
1 changed files with 2 additions and 13 deletions
|
@ -289,19 +289,8 @@ def noproblem3():
|
|||
inner()
|
||||
y = 1
|
||||
|
||||
try:
|
||||
errorInOuter()
|
||||
except UnboundLocalError:
|
||||
pass
|
||||
else:
|
||||
self.fail()
|
||||
|
||||
try:
|
||||
errorInInner()
|
||||
except NameError:
|
||||
pass
|
||||
else:
|
||||
self.fail()
|
||||
self.assertRaises(UnboundLocalError, errorInOuter)
|
||||
self.assertRaises(NameError, errorInInner)
|
||||
|
||||
# test for bug #1501934: incorrect LOAD/STORE_GLOBAL generation
|
||||
exec """
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue