Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

- Enhancements
- Added possibility to use rich Text objects to set the description argument of a `Settable`
- Removed redundant `ipython` import which slowed application startup time

## 4.1.1 (July 9, 2026)

Expand Down
11 changes: 1 addition & 10 deletions cmd2/cmd2.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,6 @@
UnboundCompleter,
)

with contextlib.suppress(ImportError):
from IPython import start_ipython

try:
if sys.platform == "win32":
from prompt_toolkit.output.win32 import NoConsoleScreenBufferError # type: ignore[attr-defined]
Expand Down Expand Up @@ -5151,13 +5148,7 @@ def do_ipy(self, _: argparse.Namespace) -> bool | None: # pragma: no cover
# Detect whether IPython is installed
try:
import traitlets.config.loader as traitlets_loader

# Allow users to install ipython from a cmd2 prompt when needed and still have ipy command work
try:
_dummy = start_ipython # noqa: F823
except NameError:
from IPython import start_ipython

from IPython import start_ipython
from IPython.terminal.interactiveshell import TerminalInteractiveShell
from IPython.terminal.ipapp import TerminalIPythonApp
except ImportError:
Expand Down
Loading