-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
bpo-17735: make inspect.findsource raise OsError instead of IndexError wh… #23633
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
Conversation
…en co_lineno is larger than length of file (can happen if file was updated since import)
07bbd9c
to
497385a
Compare
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.
LGTM
Thanks @iritkatriel for the PR, and @taleinat for merging it 🌮🎉.. I'm working now to backport this PR to: 3.8. |
Thanks @iritkatriel for the PR, and @taleinat for merging it 🌮🎉.. I'm working now to backport this PR to: 3.9. |
…t of range (pythonGH-23633) This can happen when a file was edited after it was imported. (cherry picked from commit 2e0760b) Co-authored-by: Irit Katriel <iritkatriel@yahoo.com>
GH-23646 is a backport of this pull request to the 3.9 branch. |
…t of range (pythonGH-23633) This can happen when a file was edited after it was imported. (cherry picked from commit 2e0760b) Co-authored-by: Irit Katriel <iritkatriel@yahoo.com>
GH-23647 is a backport of this pull request to the 3.8 branch. |
…t of range (pythonGH-23633) This can happen when a file was edited after it was imported.
…en co_lineno is larger than length of file (can happen if file was updated since import)
The docstring says this function raises OSError when it can't find the source, so we make it so.
(The bpo is about the consequence of help() not handling IndexError.)
https://bugs.python.org/issue17735