@@ -255,13 +255,13 @@ def baz():
255
255
check ('from __future__ import doesnt_exist' , 1 , 1 )
256
256
check ('from __future__ import braces' , 1 , 1 )
257
257
check ('x=1\n from __future__ import division' , 2 , 1 )
258
- check ('foo(1=2)' , 1 , 6 )
258
+ check ('foo(1=2)' , 1 , 5 )
259
259
check ('def f():\n x, y: int' , 2 , 3 )
260
260
check ('[*x for x in xs]' , 1 , 2 )
261
261
check ('foo(x for x in range(10), 100)' , 1 , 5 )
262
262
check ('for 1 in []: pass' , 1 , 5 )
263
- check ('(yield i) = 2' , 1 , 11 )
264
- check ('def f(*):\n pass' , 1 , 8 )
263
+ check ('(yield i) = 2' , 1 , 2 )
264
+ check ('def f(*):\n pass' , 1 , 7 )
265
265
266
266
@cpython_only
267
267
def testSettingException (self ):
@@ -395,25 +395,31 @@ def testAttributes(self):
395
395
'filename' : 'filenameStr' , 'filename2' : None }),
396
396
(SyntaxError , (), {'msg' : None , 'text' : None ,
397
397
'filename' : None , 'lineno' : None , 'offset' : None ,
398
- 'print_file_and_line' : None }),
398
+ 'end_offset' : None , ' print_file_and_line' : None }),
399
399
(SyntaxError , ('msgStr' ,),
400
400
{'args' : ('msgStr' ,), 'text' : None ,
401
401
'print_file_and_line' : None , 'msg' : 'msgStr' ,
402
- 'filename' : None , 'lineno' : None , 'offset' : None }),
402
+ 'filename' : None , 'lineno' : None , 'offset' : None ,
403
+ 'end_offset' : None }),
403
404
(SyntaxError , ('msgStr' , ('filenameStr' , 'linenoStr' , 'offsetStr' ,
404
- 'textStr' )),
405
+ 'textStr' , 'endLinenoStr' , 'endOffsetStr' )),
405
406
{'offset' : 'offsetStr' , 'text' : 'textStr' ,
406
407
'args' : ('msgStr' , ('filenameStr' , 'linenoStr' ,
407
- 'offsetStr' , 'textStr' )),
408
+ 'offsetStr' , 'textStr' ,
409
+ 'endLinenoStr' , 'endOffsetStr' )),
408
410
'print_file_and_line' : None , 'msg' : 'msgStr' ,
409
- 'filename' : 'filenameStr' , 'lineno' : 'linenoStr' }),
411
+ 'filename' : 'filenameStr' , 'lineno' : 'linenoStr' ,
412
+ 'end_lineno' : 'endLinenoStr' , 'end_offset' : 'endOffsetStr' }),
410
413
(SyntaxError , ('msgStr' , 'filenameStr' , 'linenoStr' , 'offsetStr' ,
411
- 'textStr' , 'print_file_and_lineStr' ),
414
+ 'textStr' , 'endLinenoStr' , 'endOffsetStr' ,
415
+ 'print_file_and_lineStr' ),
412
416
{'text' : None ,
413
417
'args' : ('msgStr' , 'filenameStr' , 'linenoStr' , 'offsetStr' ,
414
- 'textStr' , 'print_file_and_lineStr' ),
418
+ 'textStr' , 'endLinenoStr' , 'endOffsetStr' ,
419
+ 'print_file_and_lineStr' ),
415
420
'print_file_and_line' : None , 'msg' : 'msgStr' ,
416
- 'filename' : None , 'lineno' : None , 'offset' : None }),
421
+ 'filename' : None , 'lineno' : None , 'offset' : None ,
422
+ 'end_lineno' : None , 'end_offset' : None }),
417
423
(UnicodeError , (), {'args' : (),}),
418
424
(UnicodeEncodeError , ('ascii' , 'a' , 0 , 1 ,
419
425
'ordinal not in range' ),
@@ -459,7 +465,7 @@ def testAttributes(self):
459
465
e = exc (* args )
460
466
except :
461
467
print ("\n exc=%r, args=%r" % (exc , args ), file = sys .stderr )
462
- raise
468
+ # raise
463
469
else :
464
470
# Verify module name
465
471
if not type (e ).__name__ .endswith ('NaiveException' ):
0 commit comments