-
Notifications
You must be signed in to change notification settings - Fork 57
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
Compatibility with IPython 8 where tracebacks are different #190
Conversation
ddcf154
to
b88a38a
Compare
tb = [] | ||
for line in output["traceback"]: | ||
line = re.sub(ipython_input_pat, '<IPY-INPUT>', strip_ansi(line)) | ||
line = re.sub(ipython8_input_pat, '<IPY-INPUT>', strip_ansi(line)) | ||
tb.append(line) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tb = [] | |
for line in output["traceback"]: | |
line = re.sub(ipython_input_pat, '<IPY-INPUT>', strip_ansi(line)) | |
line = re.sub(ipython8_input_pat, '<IPY-INPUT>', strip_ansi(line)) | |
tb.append(line) | |
tb = [ | |
re.sub(ipython8_input_pat, '<IPY-INPUT>', strip_ansi( | |
re.sub(ipython_input_pat, '<IPY-INPUT>', strip_ansi(line)) | |
) | |
for line in output['traceback'] | |
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, honestly, my implementation seems to be more readable to me but it's your codebase so, if you want to, apply this suggestion. It might be also possible to merge the two regexes to one but again, readability would suffer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was just a suggestion, I have no strong preference.
Thanks! |
Fixed #189
We cannot use different regex for different IPython versions because the testing files contain the old form so we have to use them both. All tests are passing now with IPython 8.