From 222272850a7f47d080b20b948c991914a1dd9c4f Mon Sep 17 00:00:00 2001 From: Christian Berendt Date: Wed, 14 May 2014 19:18:40 +0200 Subject: [PATCH] replaced e.message BaseException.message has been deprecated as of Python 2.6. http://legacy.python.org/dev/peps/pep-0352/ Replaced e.message with six.text_type(e) (uses unicode with Python 2.x and str with Python 3.x). Change-Id: I89aa278c337dd5985d6de28563b1d6e64ce4f95a --- tuskarclient/shell.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tuskarclient/shell.py b/tuskarclient/shell.py index 1d4b324..07e9c30 100755 --- a/tuskarclient/shell.py +++ b/tuskarclient/shell.py @@ -21,6 +21,8 @@ import logging import logging.handlers import sys +import six + from tuskarclient import client import tuskarclient.common.utils as utils from tuskarclient.openstack.common.apiclient import exceptions as exc @@ -223,7 +225,7 @@ def main(): try: TuskarShell(sys.argv[1:]).run() except exc.CommandError as e: - print(e.message, file=sys.stderr) + print(six.text_type(e), file=sys.stderr) except Exception as e: logger.exception("Exiting due to an error:") sys.exit(1)