118 """Resolve a lazily re-exported name on first access (PEP 562).
123 The attribute Python failed to find in the module globals.
128 The attribute from the defining submodule, also cached into
129 this module's globals so later lookups never reach here.
134 ``name`` is not a lazy export — the normal miss.
136 The optional distribution backing ``name`` is not installed.
137 Propagated unchanged: callers such as ``oc_chat.cli`` catch it
138 and degrade to the plain presenter.
141 target = _LAZY_EXPORTS.get(name)
143 raise AttributeError(f
"module {__name__!r} has no attribute {name!r}")
145 module_name, attribute = target
146 _dbg(
"OC_UI.TERMINAL", func, f
"resolving lazy export {name}", 4)
147 value = getattr(import_module(module_name, __name__), attribute)
148 globals()[name] = value
149 _dbg(
"OC_UI.TERMINAL", func, f
"resolved {name} from {module_name}", 4)