From 3045328977904976a6148569bb0b7a4f6b597922 2012-06-02 22:59:00 From: Jonathan Taylor Date: 2012-06-02 22:59:00 Subject: [PATCH] bug in __doc__, flushing error message from RMagic's stdout cache --- diff --git a/IPython/extensions/rmagic.py b/IPython/extensions/rmagic.py index daf9352..829ed32 100644 --- a/IPython/extensions/rmagic.py +++ b/IPython/extensions/rmagic.py @@ -140,6 +140,7 @@ class RMagics(Magics): try: value = ri.baseenv['eval'](ri.parse(line)) except (ri.RRuntimeError, ValueError) as exception: + self.flush() # otherwise next return seems to have copy of error raise RMagicError(unicode_to_str('parsing and evaluating line "%s". R traceback: "%s"\n' % (line, str_to_unicode(exception.message, 'utf-8')))) text_output = self.flush() @@ -551,7 +552,7 @@ class RMagics(Magics): __doc__ = __doc__.format( R_DOC = ' '*8 + RMagics.R.__doc__, RPUSH_DOC = ' '*8 + RMagics.Rpush.__doc__, - RPULL_DOC = ' '*8 + RMagics.Rpull.__doc__ + RPULL_DOC = ' '*8 + RMagics.Rpull.__doc__, RGET_DOC = ' '*8 + RMagics.Rget.__doc__ )