This is an archive of the discontinued LLVM Phabricator instance.

[LNT] Python 3 support: fix printing of exceptions
ClosedPublic

Authored by thopre on Oct 10 2019, 8:42 AM.

Details

Summary

A number of SQLAlchemy exception are printed by using their message
attribute. However PEP-352 deprecates this attribute from Python 2.6
onwards and drop it for Python 3 and later versions.

This commit replaces printing the message attribute by printing the
exception itself, relying on the str method. This is actually
equivalent for exceptions with only a single argument (as required for
all exceptions on Python 3) as can be seen by the message property
getter in the aforementioned PEP.