MCPcopy
hub / github.com/prompt-toolkit/ptpython / initialize_extensions

Function initialize_extensions

src/ptpython/ipython.py:269–286  ·  view source on GitHub ↗

Partial copy of `InteractiveShellApp.init_extensions` from IPython.

(shell, extensions)

Source from the content-addressed store, hash-verified

267
268
269def initialize_extensions(shell, extensions):
270 """
271 Partial copy of `InteractiveShellApp.init_extensions` from IPython.
272 """
273 try:
274 iter(extensions)
275 except TypeError:
276 pass # no extensions found
277 else:
278 for ext in extensions:
279 try:
280 shell.extension_manager.load_extension(ext)
281 except:
282 warn(
283 f"Error in loading extension: {ext}"
284 + f"\nCheck your config files in {ipy_utils.path.get_ipython_dir()}"
285 )
286 shell.showtraceback()
287
288
289def run_exec_lines(shell, exec_lines):

Callers 1

embedFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected