Skip to content
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

Use oinspect in CodeMagics._find_edit_target #1919

Merged
merged 1 commit into from Jun 11, 2012

Conversation

tkf
Copy link
Contributor

@tkf tkf commented Jun 11, 2012

inspect.getabsfile and inspect.getsourcelines are replaced by find_file and find_source_lines in IPython.core.oinspect.

Except the change of the functions, changed code is roughly equivalent to the previous one. But the changed code tries to find method in non-fake module more than previous one. I think it's OK since the failed case is caught in the next if filename is None: block anyway. As I am not completely sure what _find_edit_target (%edit) does, maybe there are something missing.

inspect.getabsfile and inspect.getsourcelines are replaced by
find_file and find_source_lines in IPython.core.oinspect.
@fperez
Copy link
Member

fperez commented Jun 11, 2012

Code looks clean, running test_pr now. Will merge if all tests are OK. Thanks!!

@fperez
Copy link
Member

fperez commented Jun 11, 2012

Test results for commit e036834 merged into master
Platform: linux2

  • python2.7: OK
  • python3.2: OK (libraries not available: cython matplotlib pymongo rpy2 wx wx.aui)

Not available for testing:

@fperez
Copy link
Member

fperez commented Jun 11, 2012

Clean tests, merging now. Thanks!

fperez added a commit that referenced this pull request Jun 11, 2012
Use oinspect in CodeMagics._find_edit_target

inspect.getabsfile and inspect.getsourcelines are replaced by find_file and find_source_lines in IPython.core.oinspect, which is our own more robust code that wraps the default one from the stdlib.
@fperez fperez merged commit dc7323f into ipython:master Jun 11, 2012
@tkf
Copy link
Contributor Author

tkf commented Jun 11, 2012

Wow. That's super quick. Thank you very much!

BTW, I couldn't find any tests for CodeMagics by simply grep'ing the source code when I wrote the patch. Does test cover the code I wrote?

@fperez
Copy link
Member

fperez commented Jun 11, 2012

The state of magics testing is fairly uneven, so any tests you contribute on this front will be very welcome (and are likely to uncover new bugs ;)

mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this pull request Nov 3, 2014
Use oinspect in CodeMagics._find_edit_target

inspect.getabsfile and inspect.getsourcelines are replaced by find_file and find_source_lines in IPython.core.oinspect, which is our own more robust code that wraps the default one from the stdlib.
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.

None yet

2 participants