Skip to content

Commit

Permalink
type fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
willmcgugan committed Mar 6, 2021
1 parent a05ff5f commit 681c14a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion rich/pretty.py
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ def _traverse(obj: Any, root: bool = False) -> Node:
open_brace, close_brace, empty = _BRACES[obj_type](obj)

if obj:
children: List[Node] = []
children = []
node = Node(
open_brace=open_brace,
close_brace=close_brace,
Expand Down
10 changes: 5 additions & 5 deletions rich/syntax.py
Original file line number Diff line number Diff line change
Expand Up @@ -521,15 +521,15 @@ def __rich_console__(
text, options=options.update(width=code_width)
)
else:
lines = console.render_lines(
syntax_lines = console.render_lines(
text,
options.update(width=code_width, height=None),
style=self.background_style,
pad=True,
new_lines=True,
)
for line in lines:
yield from line
for syntax_line in syntax_lines:
yield from syntax_line
return

lines = text.split("\n")
Expand Down Expand Up @@ -597,8 +597,8 @@ def __rich_console__(
yield from wrapped_line
yield new_line
else:
for line in wrapped_lines:
yield from line
for wrapped_line in wrapped_lines:
yield from wrapped_line
yield new_line


Expand Down
2 changes: 1 addition & 1 deletion rich/text.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ def spans(self, spans: List[Span]) -> None:
"""Set spans."""
self._spans = spans[:]

def blank_copy(self, plain:str="") -> "Text":
def blank_copy(self, plain: str = "") -> "Text":
"""Return a new Text instance with copied meta data (but not the string or spans)."""
copy_self = Text(
plain,
Expand Down

0 comments on commit 681c14a

Please sign in to comment.