Permalink
Browse files

Rename RMagicError to RInterpreterError

  • Loading branch information...
1 parent bcfb30d commit 4efc9e9f81cd1b3ac79f1b186591923e9e784000 @takluyver committed Jun 7, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 IPython/extensions/rmagic.py
@@ -60,15 +60,15 @@
)
from IPython.utils.py3compat import str_to_unicode, unicode_to_str, PY3
-class RMagicError(ri.RRuntimeError):
+class RInterpreterError(ri.RRuntimeError):
"""An error when running R code in a %%R magic cell."""
def __init__(self, line, err, stdout):
self.line = line
self.err = err.rstrip()
self.stdout = stdout.rstrip()
def __unicode__(self):
- s = 'Failed to parse and evaluate line "%s".\nR error message: "%s"' % \
+ s = 'Failed to parse and evaluate line %r.\nR error message: %r' % \
(self.line, self.err)
if self.stdout and (self.stdout != self.err):
s += '\nR stdout:\n' + self.stdout
@@ -158,7 +158,7 @@ def eval(self, line):
value = ri.baseenv['eval'](ri.parse(line))
except (ri.RRuntimeError, ValueError) as exception:
warning_or_other_msg = self.flush() # otherwise next return seems to have copy of error
- raise RMagicError(line, str_to_unicode(str(exception)), warning_or_other_msg)
+ raise RInterpreterError(line, str_to_unicode(str(exception)), warning_or_other_msg)
text_output = self.flush()
ri.set_writeconsole(old_writeconsole)
return text_output, value

0 comments on commit 4efc9e9

Please sign in to comment.