[New-bugs-announce] [issue6052] for-loop doesn't work with -c

Kandalintsev Alexandre report at bugs.python.org
Mon May 18 12:29:01 CEST 2009

New submission from Kandalintsev Alexandre <bug_hunter at messir.net>:


I found this problem:

$ python3 -c 'import sys; for line in sys.stdout: pass'
  File "<string>", line 1
    import sys; for line in sys.stdout: pass
SyntaxError: invalid syntax

Without import-statement this work great. Also code 'import sys; pass' 
works too.

components: Interpreter Core
messages: 88024
nosy: exe
severity: normal
status: open
title: for-loop doesn't work with -c
versions: Python 2.5, Python 2.6, Python 2.7, Python 3.0, Python 3.1, Python 3.2

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list