New submission from Terry J. Reedy:

C:\Users\Terry>py -2 -m idlelib.idle -c "print True"
>>> 
*** Error in script or command!
Traceback (most recent call last):
  File "<pyshell#0>", line 1
    print True
             ^
SyntaxError: invalid syntax

https://stackoverflow.com/questions/30280525/python-idle-give-a-false-syntax-error
In answer, phihag points out that PyShell.py has future import and compiles with
  code = compile(source, filename, "exec")

The fix is to add dont_inherit=True.

----------
assignee: terry.reedy
messages: 243446
nosy: terry.reedy
priority: normal
severity: normal
stage: needs patch
status: open
title: Idle 2.7 -c, -r compile with print as function.
type: behavior
versions: Python 2.7

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue24222>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to