Skip to content

Commit

Permalink
Fixed utf-8 decoding error in build.
Browse files Browse the repository at this point in the history
  • Loading branch information
squidarth authored and Sid Shanker committed May 18, 2015
1 parent 258d5ae commit de7273e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions test/run.py
Expand Up @@ -290,9 +290,12 @@ def collect_dir_tests(base_dir, test_files, check_thirdparty=False):
skip = 'Thirdparty-Library %s not found.' % lib

path = os.path.join(base_dir, f_name)
source = open(path).read()
if not is_py3:
source = unicode(source, 'UTF-8')

if is_py3:
source = open(path, encoding='utf-8').read()
else:
source = unicode(open(path).read(), 'UTF-8')

for case in collect_file_tests(StringIO(source),
lines_to_execute):
case.path = path
Expand Down

0 comments on commit de7273e

Please sign in to comment.