1
0
mirror of https://github.com/mail-in-a-box/mailinabox.git synced 2025-08-04 04:20:53 +00:00

Fixed SIM212 (if-expr-with-twisted-arms): Use with_lines if with_lines else [] instead of [] if not with_lines else with_lines

This commit is contained in:
Teal Dulcet 2023-12-22 07:24:58 -08:00
parent 7035197fd4
commit 7981859997

View File

@ -1079,7 +1079,7 @@ class ConsoleOutput(FileOutput):
class BufferedOutput:
# Record all of the instance method calls so we can play them back later.
def __init__(self, with_lines=None):
self.buf = [] if not with_lines else with_lines
self.buf = with_lines if with_lines else []
def __getattr__(self, attr):
if attr not in {"add_heading", "print_ok", "print_error", "print_warning", "print_block", "print_line"}:
raise AttributeError