summaryrefslogtreecommitdiffstats
path: root/Lib/distutils/tests
diff options
context:
space:
mode:
authorTarek Ziadé <ziade.tarek@gmail.com>2009-11-01 23:11:55 (GMT)
committerTarek Ziadé <ziade.tarek@gmail.com>2009-11-01 23:11:55 (GMT)
commit628b41f2bdebcf8b6c726855572cac17e8773c3b (patch)
treec5aaa874e17c7c520609f870f5c0c39607165cbe /Lib/distutils/tests
parentec416617e8677d3f8ab9555b4a682f1ed1cc0f72 (diff)
downloadcpython-628b41f2bdebcf8b6c726855572cac17e8773c3b.zip
cpython-628b41f2bdebcf8b6c726855572cac17e8773c3b.tar.gz
cpython-628b41f2bdebcf8b6c726855572cac17e8773c3b.tar.bz2
reapplied r74493 (after #6665 fix has been backported)
Diffstat (limited to 'Lib/distutils/tests')
-rw-r--r--Lib/distutils/tests/test_build_py.py3
-rw-r--r--Lib/distutils/tests/test_filelist.py14
2 files changed, 9 insertions, 8 deletions
diff --git a/Lib/distutils/tests/test_build_py.py b/Lib/distutils/tests/test_build_py.py
index 582f246..3e45f6e 100644
--- a/Lib/distutils/tests/test_build_py.py
+++ b/Lib/distutils/tests/test_build_py.py
@@ -69,6 +69,7 @@ class BuildPyTestCase(support.TempdirManager,
open(os.path.join(testdir, "testfile"), "w").close()
os.chdir(sources)
+ old_stdout = sys.stdout
sys.stdout = io.StringIO()
try:
@@ -87,7 +88,7 @@ class BuildPyTestCase(support.TempdirManager,
finally:
# Restore state.
os.chdir(cwd)
- sys.stdout = sys.__stdout__
+ sys.stdout = old_stdout
def test_dont_write_bytecode(self):
# makes sure byte_compile is not used
diff --git a/Lib/distutils/tests/test_filelist.py b/Lib/distutils/tests/test_filelist.py
index b9db8f6..331180d 100644
--- a/Lib/distutils/tests/test_filelist.py
+++ b/Lib/distutils/tests/test_filelist.py
@@ -9,15 +9,15 @@ class FileListTestCase(unittest.TestCase):
def test_glob_to_re(self):
# simple cases
- self.assertEquals(glob_to_re('foo*'), 'foo[^/]*$')
- self.assertEquals(glob_to_re('foo?'), 'foo[^/]$')
- self.assertEquals(glob_to_re('foo??'), 'foo[^/][^/]$')
+ self.assertEquals(glob_to_re('foo*'), 'foo[^/]*\\Z(?ms)')
+ self.assertEquals(glob_to_re('foo?'), 'foo[^/]\\Z(?ms)')
+ self.assertEquals(glob_to_re('foo??'), 'foo[^/][^/]\\Z(?ms)')
# special cases
- self.assertEquals(glob_to_re(r'foo\\*'), r'foo\\\\[^/]*$')
- self.assertEquals(glob_to_re(r'foo\\\*'), r'foo\\\\\\[^/]*$')
- self.assertEquals(glob_to_re('foo????'), r'foo[^/][^/][^/][^/]$')
- self.assertEquals(glob_to_re(r'foo\\??'), r'foo\\\\[^/][^/]$')
+ self.assertEquals(glob_to_re(r'foo\\*'), r'foo\\\\[^/]*\Z(?ms)')
+ self.assertEquals(glob_to_re(r'foo\\\*'), r'foo\\\\\\[^/]*\Z(?ms)')
+ self.assertEquals(glob_to_re('foo????'), r'foo[^/][^/][^/][^/]\Z(?ms)')
+ self.assertEquals(glob_to_re(r'foo\\??'), r'foo\\\\[^/][^/]\Z(?ms)')
def test_debug_print(self):
file_list = FileList()