From: <nr...@us...> - 2008-08-02 08:48:14
|
Revision: 5051 http://jython.svn.sourceforge.net/jython/?rev=5051&view=rev Author: nriley Date: 2008-08-02 08:48:11 +0000 (Sat, 02 Aug 2008) Log Message: ----------- Handle scripts on stdin. Modified Paths: -------------- branches/asm/src/org/python/util/jython.java Modified: branches/asm/src/org/python/util/jython.java =================================================================== --- branches/asm/src/org/python/util/jython.java 2008-08-01 23:02:47 UTC (rev 5050) +++ branches/asm/src/org/python/util/jython.java 2008-08-02 08:48:11 UTC (rev 5051) @@ -144,6 +144,10 @@ // Decide if stdin is interactive if (!opts.fixInteractive && opts.interactive) { opts.interactive = ((PyFile)Py.defaultSystemState.stdin).isatty(); + if (!opts.interactive) { + PySystemState systemState = Py.getSystemState(); + systemState.ps1 = systemState.ps2 = new PyString(); + } } // Print banner and copyright information (or not) @@ -245,7 +249,7 @@ } } - if (opts.fixInteractive || opts.interactive) { + if (opts.fixInteractive || (opts.filename == null && opts.command == null)) { if (opts.encoding == null) { opts.encoding = PySystemState.registry.getProperty( "python.console.encoding", null); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |