gh-117174: Add a new route in linecache to fetch interactive source code (#117500)

This commit is contained in:
Pablo Galindo Salgado 2025-03-10 21:54:05 +00:00 committed by GitHub
parent ecdf6b15b0
commit a931a8b324
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 142 additions and 93 deletions

View file

@ -213,7 +213,7 @@ class TestInteractiveInterpreter(unittest.TestCase):
p.stdin.write(user_input)
user_input2 = dedent("""
import linecache
print(linecache.cache['<stdin>-1'])
print(linecache._interactive_cache[id(foo.__code__)])
""")
p.stdin.write(user_input2)
output = kill_python(p)