Skip to content

Fix string input2 #265

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
5 commits merged into from
Feb 9, 2011
Merged

Fix string input2 #265

5 commits merged into from
Feb 9, 2011

Conversation

fperez
Copy link
Member

@fperez 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.

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.
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.
@rkern
Copy link
Contributor

rkern commented Feb 8, 2011

+1

@takluyver
Copy link
Member

Looks good to me.

@fperez
Copy link
Member Author

fperez commented Feb 9, 2011

Thanks a lot for the reviews! Pushed and closed.

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants