1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
From: Sebastian Ramacher <sebastian@ramacher.at>
Date: Thu, 26 Mar 2026 14:53:38 +0100
Subject: Fix compatibility of linecache with Python 3.13.12 and Python 3.14.3
---
bpython/patch_linecache.py | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/bpython/patch_linecache.py b/bpython/patch_linecache.py
index fa8e172..78b3568 100644
--- a/bpython/patch_linecache.py
+++ b/bpython/patch_linecache.py
@@ -36,6 +36,11 @@ class BPythonLinecache(dict):
)
return filename
+ def get(self, key: Any, default: Any | None = None) -> Any:
+ if self.is_bpython_filename(key):
+ return self.get_bpython_history(key)
+ return super().get(key, default)
+
def __getitem__(self, key: Any) -> Any:
if self.is_bpython_filename(key):
return self.get_bpython_history(key)
|