@@ -32,13 +32,13 @@ def b():
3232
3333try :
3434 del b .__dict__
35- except ( AttributeError , TypeError ) : pass
35+ except TypeError : pass
3636else : raise TestFailed , 'del func.__dict__ expected TypeError'
3737
3838b .publish = 1
3939try :
4040 b .__dict__ = None
41- except ( AttributeError , TypeError ) : pass
41+ except TypeError : pass
4242else : raise TestFailed , 'func.__dict__ = None expected TypeError'
4343
4444d = {'hello' : 'world' }
@@ -108,7 +108,7 @@ def b():
108108# try setting __dict__
109109try :
110110 F .a .__dict__ = (1 , 2 , 3 )
111- except ( AttributeError , TypeError ) : pass
111+ except TypeError : pass
112112else : raise TestFailed , 'expected TypeError'
113113
114114F .a .im_func .__dict__ = {'one' : 11 , 'two' : 22 , 'three' : 33 }
@@ -121,7 +121,7 @@ def b():
121121
122122try :
123123 F .a .__dict__ = d
124- except ( AttributeError , TypeError ) : pass
124+ except TypeError : pass
125125else : raise TestFailed
126126
127127if f2 .a .one <> f1 .a .one <> F .a .one <> 11 :
@@ -171,17 +171,17 @@ def another():
171171
172172try :
173173 del another .__dict__
174- except ( AttributeError , TypeError ) : pass
174+ except TypeError : pass
175175else : raise TestFailed
176176
177177try :
178178 del another .func_dict
179- except ( AttributeError , TypeError ) : pass
179+ except TypeError : pass
180180else : raise TestFailed
181181
182182try :
183183 another .func_dict = None
184- except ( AttributeError , TypeError ) : pass
184+ except TypeError : pass
185185else : raise TestFailed
186186
187187try :
@@ -218,13 +218,13 @@ def cantset(obj, name, value):
218218 verify (hasattr (obj , name )) # Otherwise it's probably a typo
219219 try :
220220 setattr (obj , name , value )
221- except ( AttributeError , TypeError ) :
221+ except TypeError :
222222 pass
223223 else :
224224 raise TestFailed , "shouldn't be able to set %s to %r" % (name , value )
225225 try :
226226 delattr (obj , name )
227- except ( AttributeError , TypeError ) :
227+ except TypeError :
228228 pass
229229 else :
230230 raise TestFailed , "shouldn't be able to del %s" % name
0 commit comments