Raise InvalidRequirement/Marker from exc#593
Conversation
|
I think I would rather see the change be |
|
Do you have an opinion, @pradyunsg ? |
|
I don’t have any opinion either way, |
|
I mostly made this PR because I found this traceback excessively big considering both exceptions convey the same amount of information. Still, I guess it would make more sense to use |
|
Then please use the |
| req = _RequirementTuple(*parse_named_requirement(requirement_string)) | ||
| except ParseExceptionError as e: | ||
| raise InvalidRequirement(str(e)) | ||
| raise InvalidRequirement(str(e)) from e |
There was a problem hiding this comment.
I'm not sure if repeating the string from e gets us anything. I think raising the appropriate exception is important for except clauses, but a person looking at the output can look at the traceback to see what ultimately triggered the exception.
| raise InvalidRequirement(str(e)) from e | |
| raise InvalidRequirement from e |
This PR uses
raise from excsyntax to improve the traceback from:to: