]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
#8720: fix inspect regression by teaching getsourcefile about linecache.
authorR. David Murray <rdmurray@bitdance.com>
Thu, 17 Jun 2010 01:36:52 +0000 (01:36 +0000)
committerR. David Murray <rdmurray@bitdance.com>
Thu, 17 Jun 2010 01:36:52 +0000 (01:36 +0000)
commitdf1cf301c2da740f9271b3ff164d7f0e5cb9082c
tree7336b800dfff0f8cff9b5bbba63b8c2bfce154a1
parenta3e3e36de751607cd2d7f1eaa6ae93cf123c3c8a
#8720: fix inspect regression by teaching getsourcefile about linecache.

The fix for issue 4050 caused a regression:  before that fix, source
lines in the linecache would eventually be found by inspect.  After the
fix inspect reports an error earlier, and the source isn't found.
The fix for the fix is to have getsourcefile look in the linecache for
the file and return the psuedo-filename if the source is there, just as
it already returns it if there is a PEP 302 loader.
Lib/inspect.py
Lib/test/test_inspect.py
Misc/NEWS