Skip to content

Commit

Permalink
Silence PickleShare warnings when completing root modules.
Browse files Browse the repository at this point in the history
A better way woudl be to try to use the shelves module ?
  • Loading branch information
Carreau committed Nov 24, 2023
1 parent 86d44b7 commit ec51c50
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 4 additions & 1 deletion IPython/core/completerlib.py
Expand Up @@ -117,7 +117,10 @@ def get_root_modules():
# Don't try to scan for modules every time.
return list(sys.builtin_module_names)

rootmodules_cache = ip.db.get('rootmodules_cache', {})
if getattr(ip.db, "_mock", False):
rootmodules_cache = {}
else:
rootmodules_cache = ip.db.get("rootmodules_cache", {})
rootmodules = list(sys.builtin_module_names)
start_time = time()
store = False
Expand Down
2 changes: 2 additions & 0 deletions IPython/core/interactiveshell.py
Expand Up @@ -42,6 +42,8 @@
except ModuleNotFoundError:

class PickleShareDB: # type: ignore [no-redef]
_mock = True

def __init__(self, path):
pass

Expand Down

0 comments on commit ec51c50

Please sign in to comment.