8000 Fix exception causes in 7 modules by cool-RR · Pull Request #12381 · ipython/ipython · GitHub
[go: up one dir, main page]

Skip to content

Fix exception causes in 7 modules #12381

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
merged 1 commit into from
Jun 10, 2020

Conversation

cool-RR
Copy link
Contributor
@cool-RR cool-RR commented Jun 10, 2020

This is a continuation of #12377 .

@cool-RR
Copy link
Contributor Author
cool-RR commented Jun 10, 2020

@Carreau

@Carreau
Copy link
Member
Carreau commented Jun 10, 2020

Thanks, will have a look, no need to ping me either, I'll end up looking at PR anyway.

except Exception:
raise ValueError("Precision must be int or format string, not %r"%new)
except Exception as e:
raise ValueError("Precision must be int or format string, not %r"%new) from e
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, that for example one of the example where I thing "from None" would be useful. The fact that we catch an exception from fmt%3.14159 is an implementation detail, which I think could be hidden from user.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand. I personally hate from None, and I think that when people are debugging they have a very different mindset than when they are writing code. When you're debugging, and you get a very limited amount of information that may have been copy-pasted in an email by a non-technical person, you're very desperate for the information.

In this case, I would have wanted to see the t%3.14159 traceback. I would maybe get a hint on what happened. If it's a dead end for exploration, I at least want to know its content before I rule it out as a dead end.

So I'm a "conscientious objector" to from None. In any of the places I change to from e that you would prefer from None, point them out and I'll just remove my change from that line. I'm okay with someone else making the change to from None, but I don't want to personally be the reason that some developer didn't get the debugging data they wanted.

@Carreau Carreau added this to the 8.0 milestone Jun 10, 2020
@Carreau Carreau merged commit 66921af into ipython:master Jun 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0