Fix formatting of trailing comma with black

This commit is contained in:
Ircama 2024-07-08 09:53:38 +02:00
parent f7d9e305d8
commit 332a6967a6

View file

@ -317,8 +317,9 @@ if __name__ == "__main__":
)
try:
import black
mode = black.Mode(line_length=args.line_length)
dict_str = black.format_str(repr(printer_config), mode=mode)
printer_config = "PRINTER_CONFIG = " + repr(printer_config)
mode = black.Mode(line_length=args.line_length, magic_trailing_comma=False)
dict_str = black.format_str(printer_config, mode=mode)
except Exception:
import pprint
dict_str = pprint.pformat(printer_config)