mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
Issue #24485: Function source inspection fails on closures.
The fix for Issue #21217 introduced a regression that caused `inspect.getsource` to return incorrect results on nested functions. The root cause of the regression was due to switching the implementation to analyze the underlying bytecode instead of the source code. This commit switches things back to analyzing the source code in a more complete way. The original bug and the regression are both fixed by the new source code analysis.
This commit is contained in:
commit
f98c35a816
3 changed files with 29 additions and 5 deletions
|
|
@ -464,7 +464,6 @@ class TestDecorators(GetSourceBase):
|
|||
def test_getsource_unwrap(self):
|
||||
self.assertSourceEqual(mod2.real, 130, 132)
|
||||
|
||||
@unittest.expectedFailure
|
||||
def test_decorator_with_lambda(self):
|
||||
self.assertSourceEqual(mod2.func114, 113, 115)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue