@@ -452,24 +452,25 @@ def process_input(self, data, input_prompt, lineno):
452
452
# unless :okexcept: has been specified.
453
453
if not is_okexcept and "Traceback" in output :
454
454
s = "\n Exception in %s at block ending on line %s\n " % (filename , lineno )
455
- sys .stdout .write ('\n \n >>>' + '-' * 73 )
455
+ s += "Specify :okexcept: as an option in the ipython:: block to suppress this message\n "
456
+ sys .stdout .write ('\n \n >>>' + ('-' * 73 ))
456
457
sys .stdout .write (s )
457
458
sys .stdout .write (output )
458
- sys .stdout .write ('<<<' + '-' * 73 + '\n \n ' )
459
+ sys .stdout .write ('<<<' + ( '-' * 73 ) + '\n \n ' )
459
460
460
461
# output any warning raised during execution to stdout
461
462
# unless :okwarning: has been specified.
462
463
if not is_okwarning :
463
- import textwrap
464
464
for w in ws :
465
465
s = "\n Warning in %s at block ending on line %s\n " % (filename , lineno )
466
- sys .stdout .write ('\n \n >>>' + '-' * 73 )
466
+ s += "Specify :okwarning: as an option in the ipython:: block to suppress this message\n "
467
+ sys .stdout .write ('\n \n >>>' + ('-' * 73 ))
467
468
sys .stdout .write (s )
468
- sys .stdout .write ('-' * 76 + '\n ' )
469
+ sys .stdout .write ('-' * 76 + '\n ' )
469
470
s = warnings .formatwarning (w .message , w .category ,
470
471
w .filename , w .lineno , w .line )
471
- sys .stdout .write (' \n ' . join ( textwrap . wrap ( s , 80 )) )
472
- sys .stdout .write ('\n <<<' + '-' * 73 + '\n ' )
472
+ sys .stdout .write (s )
473
+ sys .stdout .write ('<<<' + ( '-' * 73 ) + '\n ' )
473
474
474
475
self .cout .truncate (0 )
475
476
return (ret , input_lines , output , is_doctest , decorator , image_file ,
0 commit comments