summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_funcattrs.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2001-09-18 03:55:22 (GMT)
committerGuido van Rossum <guido@python.org>2001-09-18 03:55:22 (GMT)
commitdb2a902dee92a7569ad08ddff899955925a903e0 (patch)
treeb7cc222ebc4190c01744eda4c71f7bcd4afe944a /Lib/test/test_funcattrs.py
parentf0b35e1501f279aba1b97df068c6bc7384e2ab1a (diff)
downloadcpython-db2a902dee92a7569ad08ddff899955925a903e0.zip
cpython-db2a902dee92a7569ad08ddff899955925a903e0.tar.gz
cpython-db2a902dee92a7569ad08ddff899955925a903e0.tar.bz2
Undo some (but not all) of the more lenient acceptance of
(AttributeError, TypeError) -- the leniency wasn't needed everywhere.
Diffstat (limited to 'Lib/test/test_funcattrs.py')
-rw-r--r--Lib/test/test_funcattrs.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/Lib/test/test_funcattrs.py b/Lib/test/test_funcattrs.py
index fb786ad..2411f6a 100644
--- a/Lib/test/test_funcattrs.py
+++ b/Lib/test/test_funcattrs.py
@@ -32,13 +32,13 @@ if 'publish' not in dir(b):
try:
del b.__dict__
-except (AttributeError, TypeError): pass
+except TypeError: pass
else: raise TestFailed, 'del func.__dict__ expected TypeError'
b.publish = 1
try:
b.__dict__ = None
-except (AttributeError, TypeError): pass
+except TypeError: pass
else: raise TestFailed, 'func.__dict__ = None expected TypeError'
d = {'hello': 'world'}
@@ -108,7 +108,7 @@ if f1.a.myclass is not f2.a.myclass or \
# try setting __dict__
try:
F.a.__dict__ = (1, 2, 3)
-except (AttributeError, TypeError): pass
+except TypeError: pass
else: raise TestFailed, 'expected TypeError'
F.a.im_func.__dict__ = {'one': 11, 'two': 22, 'three': 33}
@@ -121,7 +121,7 @@ d = UserDict({'four': 44, 'five': 55})
try:
F.a.__dict__ = d
-except (AttributeError, TypeError): pass
+except TypeError: pass
else: raise TestFailed
if f2.a.one <> f1.a.one <> F.a.one <> 11:
@@ -171,17 +171,17 @@ def another():
try:
del another.__dict__
-except (AttributeError, TypeError): pass
+except TypeError: pass
else: raise TestFailed
try:
del another.func_dict
-except (AttributeError, TypeError): pass
+except TypeError: pass
else: raise TestFailed
try:
another.func_dict = None
-except (AttributeError, TypeError): pass
+except TypeError: pass
else: raise TestFailed
try:
@@ -218,13 +218,13 @@ def cantset(obj, name, value):
verify(hasattr(obj, name)) # Otherwise it's probably a typo
try:
setattr(obj, name, value)
- except (AttributeError, TypeError):
+ except TypeError:
pass
else:
raise TestFailed, "shouldn't be able to set %s to %r" % (name, value)
try:
delattr(obj, name)
- except (AttributeError, TypeError):
+ except TypeError:
pass
else:
raise TestFailed, "shouldn't be able to del %s" % name