fix 'undeclared name not builtin: StandardError' on Python3