Skip to content

Commit

Permalink
Merge pull request #2635 from cilki/fix_nuitka_syntax_error
Browse files Browse the repository at this point in the history
Fix syntax error when building with nuitka
  • Loading branch information
willmcgugan committed Mar 4, 2023
2 parents 634a3f6 + 1876380 commit 13e238b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions rich/pretty.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ def display_hook(value: Any) -> None:
)
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

Expand All @@ -272,7 +272,7 @@ def __call__(self, value: Any) -> Any:
# 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


Expand Down

0 comments on commit 13e238b

Please sign in to comment.