summaryrefslogtreecommitdiffstats
path: root/Lib/distutils/tests
diff options
context:
space:
mode:
authorTarek Ziadé <ziade.tarek@gmail.com>2009-07-12 08:27:26 (GMT)
committerTarek Ziadé <ziade.tarek@gmail.com>2009-07-12 08:27:26 (GMT)
commitc9e6cecdce65a14803dbf539b5bf776edcced562 (patch)
treec856aa1e8330384e5d4b1ee1f705328d3e0c6cd3 /Lib/distutils/tests
parent1bbb19aad2a94e2abf62064c5f0ad618e2b5c43d (diff)
downloadcpython-c9e6cecdce65a14803dbf539b5bf776edcced562.zip
cpython-c9e6cecdce65a14803dbf539b5bf776edcced562.tar.gz
cpython-c9e6cecdce65a14803dbf539b5bf776edcced562.tar.bz2
Fixed #6438: distutils.cygwinccompiler.get_versions was trying to use a re string pattern on a bytes
Diffstat (limited to 'Lib/distutils/tests')
-rw-r--r--Lib/distutils/tests/test_cygwinccompiler.py17
1 files changed, 9 insertions, 8 deletions
diff --git a/Lib/distutils/tests/test_cygwinccompiler.py b/Lib/distutils/tests/test_cygwinccompiler.py
index c5a6495..a57694d 100644
--- a/Lib/distutils/tests/test_cygwinccompiler.py
+++ b/Lib/distutils/tests/test_cygwinccompiler.py
@@ -2,7 +2,7 @@
import unittest
import sys
import os
-from io import StringIO
+from io import BytesIO
import subprocess
from distutils import cygwinccompiler
@@ -19,7 +19,8 @@ class FakePopen(object):
self.cmd = cmd.split()[0]
exes = self.test_class._exes
if self.cmd in exes:
- self.stdout = StringIO(exes[self.cmd])
+ # issue #6438 in Python 3.x, Popen returns bytes
+ self.stdout = BytesIO(exes[self.cmd])
else:
self.stdout = os.popen(cmd, 'r')
@@ -87,30 +88,30 @@ class CygwinCCompilerTestCase(support.TempdirManager,
self.assertEquals(get_versions(), (None, None, None))
# Let's fake we have 'gcc' and it returns '3.4.5'
- self._exes['gcc'] = 'gcc (GCC) 3.4.5 (mingw special)\nFSF'
+ self._exes['gcc'] = b'gcc (GCC) 3.4.5 (mingw special)\nFSF'
res = get_versions()
self.assertEquals(str(res[0]), '3.4.5')
# and let's see what happens when the version
# doesn't match the regular expression
# (\d+\.\d+(\.\d+)*)
- self._exes['gcc'] = 'very strange output'
+ self._exes['gcc'] = b'very strange output'
res = get_versions()
self.assertEquals(res[0], None)
# same thing for ld
- self._exes['ld'] = 'GNU ld version 2.17.50 20060824'
+ self._exes['ld'] = b'GNU ld version 2.17.50 20060824'
res = get_versions()
self.assertEquals(str(res[1]), '2.17.50')
- self._exes['ld'] = '@(#)PROGRAM:ld PROJECT:ld64-77'
+ self._exes['ld'] = b'@(#)PROGRAM:ld PROJECT:ld64-77'
res = get_versions()
self.assertEquals(res[1], None)
# and dllwrap
- self._exes['dllwrap'] = 'GNU dllwrap 2.17.50 20060824\nFSF'
+ self._exes['dllwrap'] = b'GNU dllwrap 2.17.50 20060824\nFSF'
res = get_versions()
self.assertEquals(str(res[2]), '2.17.50')
- self._exes['dllwrap'] = 'Cheese Wrap'
+ self._exes['dllwrap'] = b'Cheese Wrap'
res = get_versions()
self.assertEquals(res[2], None)