@@ -107,7 +107,7 @@ def _test_get_by_descriptor(self, current_type):
107107 self .assertEqual (current_type .__dict__ ['InitOnlySimpleInterfaceField' ].__get__ (None , current_type ).Flag , 50 )
108108
109109 for t in [current_type , SimpleStruct , SimpleClass ]:
110- self .assertRaisesRegexp (TypeError , "(expected .*, got type)" , lambda : current_type .__dict__ ['InitOnlySimpleGenericClassField' ].__get__ (t , current_type ))
110+ self .assertRaisesRegex (TypeError , "(expected .*, got type)" , lambda : current_type .__dict__ ['InitOnlySimpleGenericClassField' ].__get__ (t , current_type ))
111111
112112 for t in [None , o , SimpleClass , SimpleStruct ]:
113113 self .assertEqual (current_type .__dict__ ['InitOnlyEnumField' ].__get__ (None , t ), EnumInt16 .B )
@@ -144,7 +144,7 @@ def f22(): o.InitOnlySimpleGenericClassField = None
144144 def f23 (): o .InitOnlySimpleInterfaceField = ClassImplementSimpleInterface (40 )
145145
146146 for f in [f1 , f2 , f3 , f4 , f5 , f6 , f7 , f8 , f9 , f10 , f11 , f12 , f13 , f14 , f15 , f16 , f17 , f18 , f19 , f20 , f21 , f22 , f23 ]:
147- self .assertRaisesRegexp (AttributeError , "attribute .* of .* object is read-only" , f )
147+ self .assertRaisesRegex (AttributeError , "attribute .* of .* object is read-only" , f )
148148
149149 def _test_set_by_type (self , current_type , message = "attribute '.*' of '.*' object is read-only" ):
150150 import System
@@ -177,7 +177,7 @@ def f22(): current_type.InitOnlySimpleGenericClassField = None
177177 def f23 (): current_type .InitOnlySimpleInterfaceField = ClassImplementSimpleInterface (40 )
178178
179179 for f in [f1 , f2 , f3 , f4 , f5 , f6 , f7 , f8 , f9 , f10 , f11 , f12 , f13 , f14 , f15 , f16 , f17 , f18 , f19 , f20 , f21 , f22 , f23 ]:
180- self .assertRaisesRegexp (AttributeError , message , f )
180+ self .assertRaisesRegex (AttributeError , message , f )
181181
182182 def _test_set_by_descriptor (self , current_type ):
183183 o = current_type ()
@@ -189,7 +189,7 @@ def _test_set_by_descriptor(self, current_type):
189189 lambda : current_type .__dict__ ['InitOnlyBooleanField' ].__set__ (None , False ),
190190 lambda : current_type .__dict__ ['InitOnlySimpleClassField' ].__set__ (None , None ),
191191 ]:
192- self .assertRaisesRegexp (AttributeError , "'.*' object attribute '.*' is read-only" , f ) # ???
192+ self .assertRaisesRegex (AttributeError , "'.*' object attribute '.*' is read-only" , f ) # ???
193193
194194 for f in [
195195 lambda : current_type .__dict__ ['InitOnlySByteField' ].__set__ (o , 3 ),
@@ -206,7 +206,7 @@ def _test_set_by_descriptor(self, current_type):
206206 lambda : current_type .__dict__ ['InitOnlyEnumField' ].__set__ (current_type , EnumInt32 .C ),
207207 lambda : current_type .__dict__ ['InitOnlySimpleInterfaceField' ].__set__ (o , None ),
208208 ]:
209- self .assertRaisesRegexp (AttributeError , "'.*' object attribute 'InitOnly.*Field' is read-only" , f )
209+ self .assertRaisesRegex (AttributeError , "'.*' object attribute 'InitOnly.*Field' is read-only" , f )
210210
211211 def _test_delete_via_type (self , current_type , message = "cannot delete attribute 'InitOnly.*' of builtin type" ):
212212 def f1 (): del current_type .InitOnlyByteField
@@ -237,7 +237,7 @@ def f22(): del current_type.InitOnlySimpleGenericClassField
237237 def f23 (): del current_type .InitOnlySimpleInterfaceField
238238
239239 for f in [f1 , f2 , f3 , f4 , f5 , f6 , f7 , f8 , f9 , f10 , f11 , f12 , f13 , f14 , f15 , f16 , f17 , f18 , f19 , f20 , f21 , f22 , f23 ]:
240- self .assertRaisesRegexp (AttributeError , message , f )
240+ self .assertRaisesRegex (AttributeError , message , f )
241241
242242 def _test_delete_via_instance (self , current_type , message = "cannot delete attribute 'InitOnly.*' of builtin type" ):
243243 o = current_type ()
@@ -269,7 +269,7 @@ def f22(): del o.InitOnlySimpleGenericClassField
269269 def f23 (): del o .InitOnlySimpleInterfaceField
270270
271271 for f in [f1 , f2 , f3 , f4 , f5 , f6 , f7 , f8 , f9 , f10 , f11 , f12 , f13 , f14 , f15 , f16 , f17 , f18 , f19 , f20 , f21 , f22 , f23 ]:
272- self .assertRaisesRegexp (AttributeError , message , f )
272+ self .assertRaisesRegex (AttributeError , message , f )
273273
274274 def _test_delete_via_descriptor (self , current_type ):
275275 o = current_type ()
@@ -285,7 +285,7 @@ def _test_delete_via_descriptor(self, current_type):
285285 if i % 4 == 3 : arg = SimpleStruct
286286 i += 1
287287
288- self .assertRaisesRegexp (AttributeError , "cannot delete attribute 'InitOnly.*Field' of builtin type" ,
288+ self .assertRaisesRegex (AttributeError , "cannot delete attribute 'InitOnly.*Field' of builtin type" ,
289289 lambda : current_type .__dict__ ['InitOnly%sField' % x ].__delete__ (arg ))
290290
291291 def test_types (self ):
0 commit comments