diff --git a/IPython/Extensions/ipy_profile_doctest.py b/IPython/Extensions/ipy_profile_doctest.py index f8eb372..b35074e 100644 --- a/IPython/Extensions/ipy_profile_doctest.py +++ b/IPython/Extensions/ipy_profile_doctest.py @@ -27,13 +27,11 @@ def main(): o.prompt_in2 = '... ' o.prompt_out = '' - # No separation between successive inputs - o.separate_in = '' + # Add a blank line before each new set of inputs. This is needed by + # doctest to distinguish each test from the next. + o.separate_in = '\n' o.separate_out = '' - # But add a blank line after any output, to help separate doctests from - # each other. This is needed by doctest to distinguish each test from the - # next. - o.separate_out2 = '\n' + o.separate_out2 = '' # Disable pprint, so that outputs are printed as similarly to standard # python as possible diff --git a/IPython/Magic.py b/IPython/Magic.py index 32c7df1..be6fd13 100644 --- a/IPython/Magic.py +++ b/IPython/Magic.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- """Magic functions for InteractiveShell. -$Id: Magic.py 2601 2007-08-10 07:01:29Z fperez $""" +$Id: Magic.py 2607 2007-08-13 13:25:24Z fperez $""" #***************************************************************************** # Copyright (C) 2001 Janko Hauser and @@ -2964,17 +2964,17 @@ Defaulting color scheme to 'NoColor'""" oc.prompt2.p_template = '... ' oc.prompt_out.p_template = '' - oc.prompt1.sep = '' - oc.prompt_out.output_sep = '' - oc.prompt_out.output_sep2 = '\n' + oc.prompt1.sep = '\n' + oc.output_sep = '' + oc.output_sep2 = '' oc.prompt1.pad_left = oc.prompt2.pad_left = \ oc.prompt_out.pad_left = False - shell.magic_xmode('Plain') - rc.pprint = False + shell.magic_xmode('Plain') + else: # turn off ipaste.deactivate_prefilter() @@ -2984,15 +2984,16 @@ Defaulting color scheme to 'NoColor'""" oc.prompt_out.p_template = rc.prompt_out oc.prompt1.sep = dstore.rc_separate_in - oc.prompt_out.output_sep = dstore.rc_separate_out - oc.prompt_out.output_sep2 = dstore.rc_separate_out2 + oc.output_sep = dstore.rc_separate_out + oc.output_sep2 = dstore.rc_separate_out2 oc.prompt1.pad_left = oc.prompt2.pad_left = \ oc.prompt_out.pad_left = dstore.rc_prompts_pad_left - shell.magic_xmode(dstore.xmode) rc.pprint = dstore.rc_pprint + shell.magic_xmode(dstore.xmode) + # Store new mode and inform dstore.mode = bool(1-int(mode)) print 'Doctest mode is:', diff --git a/IPython/Release.py b/IPython/Release.py index 467ebb8..31f0df7 100644 --- a/IPython/Release.py +++ b/IPython/Release.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- """Release data for the IPython project. -$Id: Release.py 2602 2007-08-12 22:45:38Z fperez $""" +$Id: Release.py 2607 2007-08-13 13:25:24Z fperez $""" #***************************************************************************** # Copyright (C) 2001-2006 Fernando Perez @@ -22,7 +22,7 @@ name = 'ipython' # because bdist_rpm does not accept dashes (an RPM) convention, and # bdist_deb does not accept underscores (a Debian convention). -revision = '2601' +revision = '2606' version = '0.8.2.svn.r' + revision.rstrip('M') diff --git a/doc/ChangeLog b/doc/ChangeLog index bcc820c..8e7a6e5 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,5 +1,9 @@ 2007-08-13 Fernando Perez + * IPython/Magic.py (magic_doctest_mode): fix prompt separators in + doctest profile and %doctest_mode, so they actually generate the + blank lines needed by doctest to separate individual tests. + * IPython/iplib.py (safe_execfile): modify so that running code which calls sys.exit(0) (or equivalently, raise SystemExit(0)) doesn't get a printed traceback. Any other value in sys.exit(),