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: I590749a1d05f39350996ec5ce5838b9c90baeb92
This commit is contained in:
Christian Berendt
2014-05-14 19:17:32 +02:00
parent 85857724d4
commit 9d4485217a

View File

@@ -627,7 +627,7 @@ def main():
sys.exit(130)
except Exception as e:
logger.debug(e, exc_info=1)
message = e.message
message = six.text_type(e)
if not isinstance(message, six.string_types):
message = str(message)
print("ERROR: %s" % strutils.safe_encode(message), file=sys.stderr)