We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The method for testing if a call ended with an exception is not quite accurate. Here's an example:
import pysnooper @pysnooper.snoop() def foo(): try: return None finally: pass foo()
22:07:00.954045 call 5 def foo(): 22:07:00.954555 line 6 try: 22:07:00.954637 line 7 return None 22:07:00.956724 line 9 pass Call ended by exception
I don't know of any easy reliable way to tell the difference between returning None and raising an exception inside a try/finally. For now I keep track of whether a call has raised an exception at all, and if it hasn't (like above) I know it's definitely a return. If it has, I simply don't know: https://github.com/alexmojaki/snoop/blob/a93925011365099abb8f77315060093a1efed29b/snoop/formatting.py#L271
On a related note, I started a discussion about truncating exception messages here which you may want to follow.
The text was updated successfully, but these errors were encountered:
Thanks for reporting this. Right now I think it's a small enough issue that I can ignore it.
Sorry, something went wrong.
No branches or pull requests
The method for testing if a call ended with an exception is not quite accurate. Here's an example:
I don't know of any easy reliable way to tell the difference between returning None and raising an exception inside a try/finally. For now I keep track of whether a call has raised an exception at all, and if it hasn't (like above) I know it's definitely a return. If it has, I simply don't know: https://github.com/alexmojaki/snoop/blob/a93925011365099abb8f77315060093a1efed29b/snoop/formatting.py#L271
On a related note, I started a discussion about truncating exception messages here which you may want to follow.
The text was updated successfully, but these errors were encountered: