consistent error output python2/3