diff --git a/src/sage/all.py b/src/sage/all.py index 6aef26c42a9..789889b02f7 100644 --- a/src/sage/all.py +++ b/src/sage/all.py @@ -290,6 +290,12 @@ def quit_sage(verbose=True): set_random_seed() +# Relink imported lazy_import objects to point to the appropriate namespace + +from sage.misc.lazy_import import clean_namespace +clean_namespace(globals()) +del clean_namespace + # From now on it is ok to resolve lazy imports sage.misc.lazy_import.finish_startup() diff --git a/src/sage/repl/user_globals.py b/src/sage/repl/user_globals.py index bc64972958b..92de7d87e0c 100644 --- a/src/sage/repl/user_globals.py +++ b/src/sage/repl/user_globals.py @@ -156,6 +156,8 @@ def initialize_globals(all, g=None): for key in dir(all): if key[0] != '_': user_globals[key] = getattr(all, key) + from sage.misc.lazy_import import clean_namespace + clean_namespace(user_globals) def get_global(name):