mirror of https://github.com/Textualize/rich.git
mypy and formatting
This commit is contained in:
parent
2daa3721ee
commit
396adbce32
|
@ -1060,7 +1060,7 @@ class Text(JupyterMixin):
|
|||
blank_lines = 0
|
||||
for line in text.split():
|
||||
match = re_indent.match(line.plain)
|
||||
if not match.group(2):
|
||||
if not match or not match.group(2):
|
||||
blank_lines += 1
|
||||
continue
|
||||
indent = match.group(1)
|
||||
|
@ -1096,4 +1096,4 @@ def __add__(self, other: Any) -> "Text":
|
|||
"""
|
||||
text = Text(code)
|
||||
text = text.with_indent_guides()
|
||||
print(text)
|
||||
print(text)
|
||||
|
|
|
@ -635,4 +635,4 @@ foo = [
|
|||
print(result.plain)
|
||||
print(repr(result.plain))
|
||||
expected = "for a in range(10):\n│ print(a)\n\nfoo = [\n│ 1,\n│ {\n│ │ 2\n│ }\n]\n"
|
||||
assert result.plain == expected
|
||||
assert result.plain == expected
|
||||
|
|
Loading…
Reference in New Issue