Merge pull request #2635 from cilki/fix_nuitka_syntax_error

Fix syntax error when building with nuitka
This commit is contained in:
Will McGugan 2023-03-04 09:18:14 +00:00 committed by GitHub
commit 13e238b97d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -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

View File

@ -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