Fix string input2 #265

Merged
5 commits merged into from Feb 9, 2011

Conversation

Projects
None yet
3 participants
Owner

fperez commented Feb 8, 2011

Completes the fix started by Robert Kern for the execution of naked strings. This fixes the case where the input is a multiline string.

The actual fix was a trivial one-liner, but I took the opportunity to clean up some aspects of our test system to simplify them and remove some odd special casing that made testing harder. This let me add some proper tests for this bug so it doesn't resurface, and there was a bit of cleanup in the process.

fperez added some commits Feb 3, 2011

Limit special-casing of _ variable to doctests.
In doctests, _ *must* be special-cased and removed from the user's
namespace because otherwise Python won't set it.  But we were doing
this special-casing unconditionally, making it impossible to write
unittests that checked the _ variable after cell execution.

This commit makes the special-casing of _ apply only in the doctest
execution (where it's needed) and leaves normal unittests alone.
Fix bug with execution of naked multiline strings.
The actual bug fix was a trivial one-line change, made here.  The rest
of the commits in this series improve our testing machinery and clean
up related code.

The actual fix was just calling the run_source instead of the run_code
method, which should only be called with compiled code objects.
Contributor

rkern commented Feb 8, 2011

+1

Owner

takluyver commented Feb 8, 2011

Looks good to me.

Owner

fperez commented Feb 9, 2011

Thanks a lot for the reviews! Pushed and closed.

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment