def initialize_extensions(shell, extensions):
    """
    Partial copy of `InteractiveShellApp.init_extensions` from IPython.
    """
    try:
        iter(extensions)
    except TypeError:
        pass  # no extensions found
    else:
        for ext in extensions:
            try:
                shell.extension_manager.load_extension(ext)
            except:
                warn(
                    f"Error in loading extension: {ext}"
                    + f"\nCheck your config files in {ipy_utils.path.get_ipython_dir()}"
                )
                shell.showtraceback()

    Partial copy of `InteractiveShellApp.init_extensions` from IPython.
    
src/ptpython/ipython.py