summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_scope.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_scope.py')
-rw-r--r--Lib/test/test_scope.py15
1 files changed, 2 insertions, 13 deletions
diff --git a/Lib/test/test_scope.py b/Lib/test/test_scope.py
index 84ceafa..ef56b88 100644
--- a/Lib/test/test_scope.py
+++ b/Lib/test/test_scope.py
@@ -272,19 +272,8 @@ def f():
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("""