Skip to content
This repository was archived by the owner on Apr 16, 2023. It is now read-only.

Conversation

@LilyFirefly
Copy link
Collaborator

* Avoid exposing rsplit implementation detail in exception message.
* Fix meshy#28.
@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 843e6d0 on Ian-Foote:error-message into 9a7e03b on meshy:master.

Copy link
Owner

Choose a reason for hiding this comment

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

Oooh python 3 shiny! I've not used this feature yet... what is the advantage of using from None here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It hides the fact that this exception was caused by rsplit raising ValueError - the end user doesn't need to know that implementation detail.

See Pep 409 for more detail.

Copy link
Owner

Choose a reason for hiding this comment

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

I take it that it does still show the stacktrace, though?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

>>> try:
...  1/0
... except ZeroDivisionError:
...  raise TypeError
... 
Traceback (most recent call last):
  File "<stdin>", line 2, in <module>
ZeroDivisionError: division by zero

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 4, in <module>
TypeError

>>> try:
...  1/0
... except ZeroDivisionError:
...  raise TypeError from None
... 
Traceback (most recent call last):
  File "<stdin>", line 4, in <module>
TypeError

Copy link
Owner

Choose a reason for hiding this comment

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

👍

meshy added a commit that referenced this pull request Oct 13, 2014
Improve import_from_dotted_path error message
@meshy meshy merged commit f9de46d into meshy:master Oct 13, 2014
@LilyFirefly LilyFirefly deleted the error-message branch October 13, 2014 10:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve error message on nav_tree.utils.import_from_dotted_path

3 participants