migration to Python3: fix printing exception message