summaryrefslogtreecommitdiffstats
path: root/Lib/linecache.py
diff options
context:
space:
mode:
authorPablo Galindo Salgado <Pablogsal@gmail.com>2023-10-13 09:25:37 (GMT)
committerGitHub <noreply@github.com>2023-10-13 09:25:37 (GMT)
commite1d8c65e1df990ef8d61b8912742e1a021395e78 (patch)
tree84956c1158b3baf33d9836a5a87b8fa6b57a0428 /Lib/linecache.py
parent898f531996f2c5399b13811682c578c4fd08afaa (diff)
downloadcpython-e1d8c65e1df990ef8d61b8912742e1a021395e78.zip
cpython-e1d8c65e1df990ef8d61b8912742e1a021395e78.tar.gz
cpython-e1d8c65e1df990ef8d61b8912742e1a021395e78.tar.bz2
gh-110805: Allow the repl to show source code and complete tracebacks (#110775)
Diffstat (limited to 'Lib/linecache.py')
-rw-r--r--Lib/linecache.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/linecache.py b/Lib/linecache.py
index 97644a8..c1c988d 100644
--- a/Lib/linecache.py
+++ b/Lib/linecache.py
@@ -180,3 +180,10 @@ def lazycache(filename, module_globals):
cache[filename] = (get_lines,)
return True
return False
+
+def _register_code(code, string, name):
+ cache[code] = (
+ len(string),
+ None,
+ [line + '\n' for line in string.splitlines()],
+ name)