Merged revisions 65686 via svnmerge from

svn+ssh://pythondev@svn.python.org/python/trunk

........
  r65686 | antoine.pitrou | 2008-08-14 23:04:30 +0200 (jeu., 14 août 2008) | 3 lines

  Issue #3476: make BufferedReader and BufferedWriter thread-safe
........
This commit is contained in:
Antoine Pitrou 2008-08-14 22:44:29 +00:00
parent 74bbea7ed7
commit 8769576477
4 changed files with 159 additions and 41 deletions

View file

@ -3,11 +3,15 @@
# See test_cmd_line_script.py for testing of script execution
import test.support, unittest
import os
import sys
import subprocess
def _spawn_python(*args):
cmd_line = [sys.executable, '-E']
cmd_line = [sys.executable]
# When testing -S, we need PYTHONPATH to work (see test_site_flag())
if '-S' not in args:
cmd_line.append('-E')
cmd_line.extend(args)
return subprocess.Popen(cmd_line, stdin=subprocess.PIPE,
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
@ -59,6 +63,16 @@ class CmdLineTest(unittest.TestCase):
self.verify_valid_flag('-Qwarnall')
def test_site_flag(self):
if os.name == 'posix':
# Workaround bug #586680 by adding the extension dir to PYTHONPATH
from distutils.util import get_platform
s = "./build/lib.%s-%.3s" % (get_platform(), sys.version)
if hasattr(sys, 'gettotalrefcount'):
s += '-pydebug'
p = os.environ.get('PYTHONPATH', '')
if p:
p += ':'
os.environ['PYTHONPATH'] = p + s
self.verify_valid_flag('-S')
def test_usage(self):