Partial copy of `InteractiveShellApp.init_extensions` from IPython.
(shell, extensions)
| 267 | |
| 268 | |
| 269 | def 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 | |
| 289 | def run_exec_lines(shell, exec_lines): |