diff --git a/weboob/tools/application/formatters/table.py b/weboob/tools/application/formatters/table.py index d11dc11d..55e74688 100644 --- a/weboob/tools/application/formatters/table.py +++ b/weboob/tools/application/formatters/table.py @@ -69,7 +69,13 @@ class TableFormatter(IFormatter): s += "\n" table = PrettyTable(list(column_headers)) for column_header in column_headers: - table.set_field_align(column_header, 'l') + # API changed in python-prettytable. The try/except is a bad hack to support both versions + # Note: two versions are not exactly the same... + # (first one: header in center. Second one: left align for header too) + try: + table.set_field_align(column_header, 'l') + except: + table.align[column_header] = 'l' for line in queue: table.add_row(line)