[commit: ghc] master: Fix check_uniques in non-unicode locale (b65363d)
git at git.haskell.org
git at git.haskell.org
Thu Jun 30 20:57:35 UTC 2016
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/b65363d3eaffd453ca0790b34a5a4dc4354e176a/ghc
>---------------------------------------------------------------
commit b65363d3eaffd453ca0790b34a5a4dc4354e176a
Author: Thomas Miedema <thomasmiedema at gmail.com>
Date: Thu Jun 30 10:32:00 2016 +0200
Fix check_uniques in non-unicode locale
Testcase: `LC_ALL=C make -C utils/checkUniques`. Works with python2 and
python3.
Reviewed by: bgamari
Differential Revision: https://phabricator.haskell.org/D2372
>---------------------------------------------------------------
b65363d3eaffd453ca0790b34a5a4dc4354e176a
utils/checkUniques/check-uniques.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/utils/checkUniques/check-uniques.py b/utils/checkUniques/check-uniques.py
index 42b375e..67322c2 100755
--- a/utils/checkUniques/check-uniques.py
+++ b/utils/checkUniques/check-uniques.py
@@ -5,6 +5,7 @@ import os.path
import sys
import re
import glob
+import io
from collections import defaultdict
# keyed on unique type, values are lists of (unique, name) pairs
@@ -12,7 +13,7 @@ def find_uniques(source_files):
uniques = defaultdict(lambda: defaultdict(lambda: set()))
unique_re = re.compile(r"([\w\d]+)\s*=\s*mk([\w\d']+)Unique\s+(\d+)")
for f in source_files:
- ms = unique_re.findall(open(f).read())
+ ms = unique_re.findall(io.open(f, encoding='utf8').read())
for m in ms:
name = m[0]
_type = m[1]
More information about the ghc-commits
mailing list