Skip to content

Commit

Permalink
work around Python 2 str() issues
Browse files Browse the repository at this point in the history
  • Loading branch information
trehn committed Jun 29, 2017
1 parent 9442476 commit 9130cf4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion bundlewrap/cmdline/metadata.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from decimal import Decimal
from json import dumps

from ..metadata import MetadataJSONEncoder, value_at_key_path
from ..utils import Fault
from ..utils.cmdline import get_node, get_target_nodes
from ..utils.table import ROW_SEPARATOR, render_table
from ..utils.text import bold, force_text, mark_for_translation as _, red
Expand All @@ -29,7 +31,9 @@ def bw_metadata(repo, args):
value = ", ".join([str(item) for item in value])
elif isinstance(value, set):
value = ", ".join(sorted(value))
values.append(str(value))
elif isinstance(value, (bool, float, int, Decimal, Fault)):
value = str(value)
values.append(value)
table.append([bold(node.name)] + values)
page_lines(render_table(table))
else:
Expand Down

0 comments on commit 9130cf4

Please sign in to comment.