import six
# Own modules
-from fb_tools.common import pp, to_bool, RE_DOT_AT_END
+from fb_tools.common import pp, to_bool, to_str, RE_DOT_AT_END
from fb_tools.errors import HandlerError, ExpectedHandlerError, CommandNotFoundError
from .xlate import XLATOR
-__version__ = '3.3.1'
+__version__ = '3.3.2'
LOG = logging.getLogger(__name__)
_ = XLATOR.gettext
# msg = _("Error on executing {cmd!r}: return value {v}.").format(
# cmd=e.cmd, v=e.returncode)
if e.stdout:
- print(self.colored("Output", 'AQUA') + ':\n' + e.stdout)
+ print(self.colored("Output", 'AQUA') + ':\n' + to_str(e.stdout))
if e.stderr:
- print(self.colored("Error message", ('BOLD', 'RED')) + ':\n' + e.stderr)
+ msg = self.colored("Error message", ('BOLD', 'RED')) + ':\n'
+ msg += to_str(e.stderr)
+ print(msg)
raise ExpectedHandlerError(str(e))
LOG.debug(_("Completed process:") + "\n" + str(result))