I\'m writing per the following, in which I try to produce a decent error message when comparing two multiline blocks of Unicode text. The interior method that does the compa
Use e.args, e.message is deprecated.
try:
assert False, "Hello!"
except AssertionError as e:
e.args += ('some other', 'important', 'information', 42)
raise
This preserves the original traceback. Its last part then looks like this:
AssertionError: ('Hello!', 'some other', 'important', 'information', 42)
Works in both Python 2.7 and Python 3.