diff options
author | Jenkins <jenkins@review.openstack.org> | 2016-05-13 14:50:06 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2016-05-13 14:50:06 +0000 |
commit | 0488b26777ba0dd71c9d94f771162fed2ac5000d (patch) | |
tree | 3f20d6ed65cb484ccae993ee5df71e6662020110 | |
parent | 82c6ef7d54f2b3a99e20a7170882745e9d6fc4a4 (diff) | |
parent | 8377a9891f81607c527715550275afd4d96a22f8 (diff) | |
download | cliff-0488b26777ba0dd71c9d94f771162fed2ac5000d.tar.gz |
Merge "Fix prettytable.PrettyTable().max_width wrong usage"
-rw-r--r-- | cliff/formatters/table.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/cliff/formatters/table.py b/cliff/formatters/table.py index d146276..fe4668e 100644 --- a/cliff/formatters/table.py +++ b/cliff/formatters/table.py @@ -136,13 +136,12 @@ class TableFormatter(ListFormatter, SingleFormatter): x.min_width = min_width if max_width > 0: - x.max_width = max_width - return - - term_width = utils.terminal_width(stdout) - if not term_width: - # not a tty, so do not set any max widths - return + term_width = max_width + else: + term_width = utils.terminal_width(stdout) + if not term_width: + # not a tty, so do not set any max widths + return field_count = len(x.field_names) try: |