diff --git a/CHANGELOG.md b/CHANGELOG.md index da679d0a..d9ce709e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +- Reversed `pre` and `code` tags in base HTML format https://github.com/Textualize/rich/pull/2642 +- Fix syntax error when building with nuitka https://github.com/Textualize/rich/pull/2635 - Fixed pretty printing of empty dataclass https://github.com/Textualize/rich/issues/2819 ### Added diff --git a/rich/pretty.py b/rich/pretty.py index f257b15a..f871cfd5 100644 --- a/rich/pretty.py +++ b/rich/pretty.py @@ -247,7 +247,7 @@ def install( ) builtins._ = value # type: ignore[attr-defined] - try: # pragma: no cover + if "get_ipython" in globals(): ip = get_ipython() # type: ignore[name-defined] from IPython.core.formatters import BaseFormatter @@ -272,7 +272,7 @@ def install( # replace plain text formatter with rich formatter rich_formatter = RichFormatter() ip.display_formatter.formatters["text/plain"] = rich_formatter - except Exception: + else: sys.displayhook = display_hook