diff options
| author | Jason R. Coombs <jaraco@jaraco.com> | 2013-06-18 14:08:20 -0500 |
|---|---|---|
| committer | Jason R. Coombs <jaraco@jaraco.com> | 2013-06-18 14:08:20 -0500 |
| commit | a85aa143f971ebfbb31ccaf58cb82a311f9315c6 (patch) | |
| tree | eeae1529ae15884aca3301fefae768fc2e531a18 /setuptools/tests/win_script_wrapper.txt | |
| parent | 94fc39cb62df19e85b07658f2fa5d0b4a7bf9303 (diff) | |
| parent | 641eac6550896506fa939205f249bcfb8f057d57 (diff) | |
| download | python-setuptools-git-a85aa143f971ebfbb31ccaf58cb82a311f9315c6.tar.gz | |
Merge Vinay Sajip's unified Python 2/3 support from distribute 3
--HG--
branch : distribute
Diffstat (limited to 'setuptools/tests/win_script_wrapper.txt')
| -rw-r--r-- | setuptools/tests/win_script_wrapper.txt | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/setuptools/tests/win_script_wrapper.txt b/setuptools/tests/win_script_wrapper.txt index 1fe47bc5..731243dd 100644 --- a/setuptools/tests/win_script_wrapper.txt +++ b/setuptools/tests/win_script_wrapper.txt @@ -17,7 +17,7 @@ Let's create a simple script, foo-script.py: >>> from setuptools.command.easy_install import nt_quote_arg >>> sample_directory = tempfile.mkdtemp() >>> f = open(os.path.join(sample_directory, 'foo-script.py'), 'w') - >>> bytes = f.write( + >>> bytes_written = f.write( ... """#!%(python_exe)s ... import sys ... input = repr(sys.stdin.read()) @@ -37,8 +37,8 @@ We'll also copy cli.exe to the sample-directory with the name foo.exe: >>> import pkg_resources >>> f = open(os.path.join(sample_directory, 'foo.exe'), 'wb') - >>> bytes = f.write( - ... pkg_resources.resource_string('setuptools', 'cli.exe') + >>> bytes_written = f.write( + ... pkg_resources.resource_string('setuptools', 'cli-32.exe') ... ) >>> f.close() @@ -82,7 +82,7 @@ options as usual. For example, to run in optimized mode and enter the interpreter after running the script, you could use -Oi: >>> f = open(os.path.join(sample_directory, 'foo-script.py'), 'w') - >>> bytes = f.write( + >>> bytes_written = f.write( ... """#!%(python_exe)s -Oi ... import sys ... input = repr(sys.stdin.read()) @@ -112,10 +112,12 @@ Now let's test the GUI version with the simple scipt, bar-script.py: >>> from setuptools.command.easy_install import nt_quote_arg >>> sample_directory = tempfile.mkdtemp() >>> f = open(os.path.join(sample_directory, 'bar-script.pyw'), 'w') - >>> bytes = f.write( + >>> bytes_written = f.write( ... """#!%(python_exe)s ... import sys - ... open(sys.argv[1], 'wb').write(repr(sys.argv[2]).encode('ascii')) + ... f = open(sys.argv[1], 'wb') + ... bytes_written = f.write(repr(sys.argv[2]).encode('utf-8')) + ... f.close() ... """ % dict(python_exe=nt_quote_arg(sys.executable))) >>> f.close() @@ -123,8 +125,8 @@ We'll also copy gui.exe to the sample-directory with the name bar.exe: >>> import pkg_resources >>> f = open(os.path.join(sample_directory, 'bar.exe'), 'wb') - >>> bytes = f.write( - ... pkg_resources.resource_string('setuptools', 'gui.exe') + >>> bytes_written = f.write( + ... pkg_resources.resource_string('setuptools', 'gui-32.exe') ... ) >>> f.close() |
