[issue31161] Only check for print and exec parentheses cases for SyntaxError, not subclasses

2017-08-22 Thread Łukasz Langa
Changes by Łukasz Langa : -- resolution: -> fixed stage: needs patch -> resolved status: open -> closed ___ Python tracker ___ ___ Py

[issue31161] Only check for print and exec parentheses cases for SyntaxError, not subclasses

2017-08-22 Thread Łukasz Langa
Łukasz Langa added the comment: New changeset 772d809a63f40fd35679da3fb115cdf7fa81bd20 by Łukasz Langa (Martijn Pieters) in branch 'master': bpo-31161: only check for parens error for SyntaxError (#3082) https://github.com/python/cpython/commit/772d809a63f40fd35679da3fb115cdf7fa81bd20 ---

[issue31161] Only check for print and exec parentheses cases for SyntaxError, not subclasses

2017-08-22 Thread Łukasz Langa
Łukasz Langa added the comment: New changeset 680f04a926bce04e4320ba883068c345eba502a6 by Łukasz Langa (Martijn Pieters) in branch '3.6': bpo-31161: only check for parens error for SyntaxError (#3083) https://github.com/python/cpython/commit/680f04a926bce04e4320ba883068c345eba502a6 --

[issue31161] Only check for print and exec parentheses cases for SyntaxError, not subclasses

2017-08-13 Thread Martijn Pieters
Changes by Martijn Pieters : -- pull_requests: +3125 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://ma

[issue31161] Only check for print and exec parentheses cases for SyntaxError, not subclasses

2017-08-13 Thread Martijn Pieters
Changes by Martijn Pieters : -- pull_requests: +3124 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://ma

[issue31161] Only check for print and exec parentheses cases for SyntaxError, not subclasses

2017-08-13 Thread Martijn Pieters
Martijn Pieters added the comment: Disregard my last message, I misread Serhiy's sentence (read 'correct' for 'incorrect'). -- ___ Python tracker ___ ___

[issue31161] Only check for print and exec parentheses cases for SyntaxError, not subclasses

2017-08-13 Thread Martijn Pieters
Martijn Pieters added the comment: This does not increase clarity. It creates confusion. There are two distinct syntax errors, and they should be reported separately, just like `print "abc" 42` is two syntax errors; you'll hear about the second one once the first one is fixed. -- ___

[issue31161] Only check for print and exec parentheses cases for SyntaxError, not subclasses

2017-08-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The current traceback is incorrect. It mixes exception type and message from different errors. -- ___ Python tracker ___

[issue31161] Only check for print and exec parentheses cases for SyntaxError, not subclasses

2017-08-12 Thread Steven D'Aprano
Steven D'Aprano added the comment: > > Perhaps the check needs to be limited to just the exact type. > Looks reasonable to me. Do you want to provide a PR Martijn? You realise that is making the current traceback *less* informative instead of more informative? I think that's going backwards --

[issue31161] Only check for print and exec parentheses cases for SyntaxError, not subclasses

2017-08-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > Perhaps the check needs to be limited to just the exact type. Looks reasonable to me. Do you want to provide a PR Martijn? -- keywords: +easy (C) nosy: +serhiy.storchaka stage: -> needs patch ___ Python tracker

[issue31161] Only check for print and exec parentheses cases for SyntaxError, not subclasses

2017-08-10 Thread Martijn Pieters
Martijn Pieters added the comment: It's confusing; a syntax error reports on the first error found, not two errors at once. The TabError or IndentationError exception detail message itself is lost (it should be "IndentationError: Improper mixture of spaces and tabs." or "TabError: Improper ind

[issue31161] Only check for print and exec parentheses cases for SyntaxError, not subclasses

2017-08-10 Thread Steven D'Aprano
Steven D'Aprano added the comment: I'm not sure whether this is a bug or a feature. In the examples you show, we have *both* an IndentationError/TabError and missing parentheses around print. So I'm almost inclined to say that this is right: - you get an IndentationError (or TabError); - and

[issue31161] Only check for print and exec parentheses cases for SyntaxError, not subclasses

2017-08-09 Thread Martijn Pieters
Martijn Pieters added the comment: Credit for uncovering this gem: https://stackoverflow.com/questions/45591883/why-is-an-indentionerror-being-raised-here-rather-than-a-syntaxerror -- ___ Python tracker __

[issue31161] Only check for print and exec parentheses cases for SyntaxError, not subclasses

2017-08-09 Thread Martijn Pieters
New submission from Martijn Pieters: SyntaxError.__init__() checks for the `print` and `exec` error cases where the user forgot to use parentheses: >>> exec 1 File "", line 1 exec 1 ^ SyntaxError: Missing parentheses in call to 'exec' >>> print 1 File "", line 1 print 1