Commit 850c569f authored by Stefan Behnel's avatar Stefan Behnel

make sure we do not break encoded scripts when extracting expected error messages in runtests.py

parent ae51384f
#!/usr/bin/python #!/usr/bin/python
import os, sys, re, shutil, unittest, doctest import os
import sys
import re
import codecs
import shutil
import unittest
import doctest
WITH_CYTHON = True WITH_CYTHON = True
...@@ -237,9 +243,10 @@ class CythonCompileTestCase(unittest.TestCase): ...@@ -237,9 +243,10 @@ class CythonCompileTestCase(unittest.TestCase):
def split_source_and_output(self, directory, module, workdir): def split_source_and_output(self, directory, module, workdir):
source_file = os.path.join(directory, module) + '.pyx' source_file = os.path.join(directory, module) + '.pyx'
source_and_output = open( source_and_output = codecs.open(
self.find_module_source_file(source_file), 'rU') self.find_module_source_file(source_file), 'rU', 'ISO-8859-1')
out = open(os.path.join(workdir, module + '.pyx'), 'w') out = codecs.open(os.path.join(workdir, module + '.pyx'),
'w', 'ISO-8859-1')
for line in source_and_output: for line in source_and_output:
last_line = line last_line = line
if line.startswith("_ERRORS"): if line.startswith("_ERRORS"):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment