New submission from Trundle <andy-pyt...@hammerhartes.de>: The original lines in Lib/codeop.py under Python 2.6:
raise SyntaxError, err1 Those lines were ported to Python 3 as: raise SyntaxError(err1) Which is wrong because `err1` is in both cases an instance of `SyntaxError`. Quote from the language reference: "If the first object is a class, it becomes the type of the exception. The second object is used to determine the exception value: If it is an instance of the class, the instance becomes the exception value." Therefore, the correct translation of that code is: "raise err1". The attached patch fixes the issue. ---------- components: Library (Lib) files: codeop_raise_syntaxerror.patch keywords: patch messages: 94185 nosy: Trundle severity: normal status: open title: raise of SyntaxError in codeop was ported incorrectly to Py3 type: behavior versions: Python 3.1, Python 3.2 Added file: http://bugs.python.org/file15157/codeop_raise_syntaxerror.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue7161> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com