From: <pj...@us...> - 2009-06-07 00:11:08
|
Revision: 6464 http://jython.svn.sourceforge.net/jython/?rev=6464&view=rev Author: pjenvey Date: 2009-06-07 00:10:28 +0000 (Sun, 07 Jun 2009) Log Message: ----------- make cmdline2list private Modified Paths: -------------- trunk/jython/Lib/subprocess.py trunk/jython/Lib/test/test_subprocess_jy.py Modified: trunk/jython/Lib/subprocess.py =================================================================== --- trunk/jython/Lib/subprocess.py 2009-06-06 21:41:26 UTC (rev 6463) +++ trunk/jython/Lib/subprocess.py 2009-06-07 00:10:28 UTC (rev 6464) @@ -547,11 +547,11 @@ # Parse command line arguments for Windows _win_oses = ['nt'] - _cmdline2list = None + _cmdline2listimpl = None _escape_args = None _shell_command = None - def cmdline2list(cmdline): + def _cmdline2list(cmdline): """Build an argv list from a Microsoft shell style cmdline str The reverse of list2cmdline that follows the same MS C runtime @@ -611,13 +611,13 @@ """Setup the shell command and the command line argument escape function depending on the underlying platform """ - global _cmdline2list, _escape_args, _shell_command + global _cmdline2listimpl, _escape_args, _shell_command if os._name in _win_oses: - _cmdline2list = cmdline2list + _cmdline2listimpl = _cmdline2list _escape_args = lambda args: [list2cmdline([arg]) for arg in args] else: - _cmdline2list = lambda args: [args] + _cmdline2listimpl = lambda args: [args] _escape_args = lambda args: args os_info = os._os_map.get(os._name) @@ -1226,7 +1226,7 @@ """Execute program (Java version)""" if isinstance(args, types.StringTypes): - args = _cmdline2list(args) + args = _cmdline2listimpl(args) else: args = list(args) # NOTE: CPython posix (execv) will str() any unicode Modified: trunk/jython/Lib/test/test_subprocess_jy.py =================================================================== --- trunk/jython/Lib/test/test_subprocess_jy.py 2009-06-06 21:41:26 UTC (rev 6463) +++ trunk/jython/Lib/test/test_subprocess_jy.py 2009-06-07 00:10:28 UTC (rev 6464) @@ -3,7 +3,7 @@ import os import sys from test import test_support -from subprocess import PIPE, Popen, cmdline2list +from subprocess import PIPE, Popen, _cmdline2list class EnvironmentInheritanceTest(unittest.TestCase): @@ -65,7 +65,7 @@ def test_cmdline2list(self): for cmdline, argv in self.cmdlines.iteritems(): - self.assertEqual(cmdline2list(cmdline), argv) + self.assertEqual(_cmdline2list(cmdline), argv) def test_main(): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |