We delay importing lazy_import_cache until a lazy star import is done (which the Sage library never does).
We change two copies of essentially the same code that tries to use SAGE_SRC and SAGE_LIB to turn a source filename to a qualified package name so that
- it does not fail when
sage.env.SAGE_SRC cannot be imported or is empty
- it replaces the use of
SAGE_LIB by using sage.__path__ (to handle namespace packages correctly)
part of Meta-ticket #33037 (Remove use of SAGE_LIB and SAGE_EXTCODE variables)
Depends on #33793
CC: @kiwifb @antonio-rojas @tornaria
Component: refactoring
Author: Matthias Koeppe
Branch/Commit: 748d9fb
Reviewer: François Bissey
Issue created by migration from https://trac.sagemath.org/ticket/33821
We delay importing
lazy_import_cacheuntil a lazy star import is done (which the Sage library never does).We change two copies of essentially the same code that tries to use
SAGE_SRCandSAGE_LIBto turn a source filename to a qualified package name so thatsage.env.SAGE_SRCcannot be imported or is emptySAGE_LIBby usingsage.__path__(to handle namespace packages correctly)part of Meta-ticket #33037 (Remove use of
SAGE_LIBandSAGE_EXTCODEvariables)Depends on #33793
CC: @kiwifb @antonio-rojas @tornaria
Component: refactoring
Author: Matthias Koeppe
Branch/Commit:
748d9fbReviewer: François Bissey
Issue created by migration from https://trac.sagemath.org/ticket/33821