@@ -109,18 +109,18 @@ def test_eval_str_invalid_escape(self):
109109 for b in range (1 , 128 ):
110110 if b in b"""\n \r "'01234567NU\\ abfnrtuvx""" :
111111 continue
112- with self .assertWarns (DeprecationWarning ):
112+ with self .assertWarns (SyntaxWarning ):
113113 self .assertEqual (eval (r"'\%c'" % b ), '\\ ' + chr (b ))
114114
115115 with warnings .catch_warnings (record = True ) as w :
116- warnings .simplefilter ('always' , category = DeprecationWarning )
116+ warnings .simplefilter ('always' , category = SyntaxWarning )
117117 eval ("'''\n \\ z'''" )
118118 self .assertEqual (len (w ), 1 )
119119 self .assertEqual (w [0 ].filename , '<string>' )
120120 self .assertEqual (w [0 ].lineno , 2 )
121121
122122 with warnings .catch_warnings (record = True ) as w :
123- warnings .simplefilter ('error' , category = DeprecationWarning )
123+ warnings .simplefilter ('error' , category = SyntaxWarning )
124124 with self .assertRaises (SyntaxError ) as cm :
125125 eval ("'''\n \\ z'''" )
126126 exc = cm .exception
@@ -158,18 +158,18 @@ def test_eval_bytes_invalid_escape(self):
158158 for b in range (1 , 128 ):
159159 if b in b"""\n \r "'01234567\\ abfnrtvx""" :
160160 continue
161- with self .assertWarns (DeprecationWarning ):
161+ with self .assertWarns (SyntaxWarning ):
162162 self .assertEqual (eval (r"b'\%c'" % b ), b'\\ ' + bytes ([b ]))
163163
164164 with warnings .catch_warnings (record = True ) as w :
165- warnings .simplefilter ('always' , category = DeprecationWarning )
165+ warnings .simplefilter ('always' , category = SyntaxWarning )
166166 eval ("b'''\n \\ z'''" )
167167 self .assertEqual (len (w ), 1 )
168168 self .assertEqual (w [0 ].filename , '<string>' )
169169 self .assertEqual (w [0 ].lineno , 2 )
170170
171171 with warnings .catch_warnings (record = True ) as w :
172- warnings .simplefilter ('error' , category = DeprecationWarning )
172+ warnings .simplefilter ('error' , category = SyntaxWarning )
173173 with self .assertRaises (SyntaxError ) as cm :
174174 eval ("b'''\n \\ z'''" )
175175 exc = cm .exception
0 commit comments