diff options
author | Amjith Ramanujam <amjith.r@gmail.com> | 2015-02-04 23:40:48 -0800 |
---|---|---|
committer | Amjith Ramanujam <amjith.r@gmail.com> | 2015-02-04 23:40:48 -0800 |
commit | 410e859b6ba425ca9f04f7a6dc67ba0124a67d89 (patch) | |
tree | 9dd71a2d2ac031af40917bf65269992029b10694 | |
parent | b6fa56728ce231e91bc75b81a52b22faa98c2095 (diff) |
Handle empty headers while converting to unicode.
-rwxr-xr-x | pgcli/main.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pgcli/main.py b/pgcli/main.py index c83aee60..933b0adc 100755 --- a/pgcli/main.py +++ b/pgcli/main.py @@ -220,8 +220,7 @@ class PGCli(object): if not click.confirm('Do you want to continue?'): click.secho("Aborted!", err=True, fg='red') break - output.extend(format_output(cur, map(utf8tounicode, - headers), status, self.table_format)) + output.extend(format_output(cur, headers, status, self.table_format)) end = time() total += end - start mutating = mutating or is_mutating(status) @@ -334,6 +333,7 @@ def cli(database, user, host, port, prompt_passwd, never_prompt, dbname, def format_output(cur, headers, status, table_format): output = [] if cur: + headers = map(utf8tounicode, headers) if is_expanded_output(): output.append(expanded_table(cur, headers)) else: |