Skip to content

Allow TryNext to have an error message without it affecting the command chain #1703

Merged
merged 1 commit into from May 9, 2012

2 participants

@takluyver
IPython member

Closes gh-211

@takluyver takluyver referenced this pull request May 6, 2012
Closed

paste command not working #211

@takluyver
IPython member

Test results for commit cdd3c85 merged into master
Platform: linux2

  • python2.7: OK
  • python3.1: OK (libraries not available: matplotlib pymongo qt wx wx.aui zmq)
  • python3.2: Failed, log at https://gist.github.com/2621700 (libraries not available: pymongo wx wx.aui)

Not available for testing: python2.6

@takluyver
IPython member

The test failure on 3.2 is issue #1699, nothing to do with this pull request.

@minrk minrk commented on the diff May 8, 2012
IPython/core/error.py
"""
- def __init__(self, *args, **kwargs):
+ def __init__(self, _msg="", *args, **kwargs):
@minrk
IPython member
minrk added a note May 8, 2012

Why is this _msg instead of msg?

@takluyver
IPython member
takluyver added a note May 8, 2012

Because you can give it keyword arguments to pass to the next function in the chain, and it's possible, if unlikely, that you might use msg as a keyword argument. So it deliberately looks special because it's handled differently to other keyword arguments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@minrk
IPython member
minrk commented May 8, 2012

Test results for commit cdd3c85 merged into master
Platform: darwin

  • python2.6: OK (libraries not available: matplotlib pymongo qt tornado wx wx.aui)
  • python2.7: OK
  • python3.2: OK (libraries not available: matplotlib pymongo qt tornado wx wx.aui)

Not available for testing:

@minrk
IPython member
minrk commented May 8, 2012

Test results for commit cdd3c85 merged into master
Platform: darwin

  • python2.6: OK (libraries not available: matplotlib pymongo qt tornado wx wx.aui)
  • python2.7: OK
  • python3.2: OK (libraries not available: matplotlib pymongo qt tornado wx wx.aui)

Not available for testing:

@minrk
IPython member
minrk commented May 9, 2012

Seems sensible to me, merging.

@minrk minrk merged commit cb19d0d into ipython:master May 9, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.