From 6ada5071d531d0fb8d3942a65ef290f62089a1ff Mon Sep 17 00:00:00 2001 From: rdb Date: Sat, 6 Dec 2025 21:04:58 +0100 Subject: [PATCH] dist: Add linecache stubs for newer versions of Python --- direct/src/dist/FreezeTool.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/direct/src/dist/FreezeTool.py b/direct/src/dist/FreezeTool.py index 93981a9c81..8f0d28d06b 100644 --- a/direct/src/dist/FreezeTool.py +++ b/direct/src/dist/FreezeTool.py @@ -201,12 +201,23 @@ def getline(filename, lineno, module_globals=None): return '' def clearcache(): - global cache - cache = {} + cache.clear() def getlines(filename, module_globals=None): return [] +def _getline_from_code(filename, lineno): + return '' + +def _make_key(code): + return (code.co_filename, code.co_qualname, code.co_firstlineno) + +def _getlines_from_code(code): + return [] + +def _source_unavailable(filename): + return True + def checkcache(filename=None): pass