forked from python/cpython
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bpo-17735: inspect.findsource now raises OSError when co_lineno is ou…
…t of range (pythonGH-23633) This can happen when a file was edited after it was imported.
- Loading branch information
1 parent
8d4f57d
commit 2e0760b
Showing
3 changed files
with
21 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
Misc/NEWS.d/next/Library/2020-12-03-22-22-24.bpo-17735.Qsaaue.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
:func:`inspect.findsource` now raises :exc:`OSError` instead of | ||
:exc:`IndexError` when :attr:`co_lineno` of a code object is greater than the | ||
file length. This can happen, for example, when a file is edited after it was | ||
imported. PR by Irit Katriel. |