mypy and formatting

This commit is contained in:
Will McGugan 2020-10-22 21:54:45 +01:00
parent 2daa3721ee
commit 396adbce32
2 changed files with 3 additions and 3 deletions

View File

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

View File

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