##// END OF EJS Templates
Merge pull request #3481 from takluyver/rmagic-nicer-errors...
Brian E. Granger -
r11098:559a339d merge
parent child Browse files
Show More
@@ -578,16 +578,24 b' class RMagics(Magics):'
578 578 self.r('png("%s/Rplots%%03d.png",%s)' % (tmpd.replace('\\', '/'), png_args))
579 579
580 580 text_output = ''
581 if line_mode:
582 for line in code.split(';'):
583 text_result, result = self.eval(line)
581 try:
582 if line_mode:
583 for line in code.split(';'):
584 text_result, result = self.eval(line)
585 text_output += text_result
586 if text_result:
587 # the last line printed something to the console so we won't return it
588 return_output = False
589 else:
590 text_result, result = self.eval(code)
584 591 text_output += text_result
585 if text_result:
586 # the last line printed something to the console so we won't return it
587 return_output = False
588 else:
589 text_result, result = self.eval(code)
590 text_output += text_result
592
593 except RInterpreterError as e:
594 print(e.stdout)
595 if not e.stdout.endswith(e.err):
596 print(e.err)
597 rmtree(tmpd)
598 return
591 599
592 600 self.r('dev.off()')
593 601
General Comments 0
You need to be logged in to leave comments. Login now