Skip to content

Commit dbf6fdd

Browse files
committed
---
yaml --- r: 225291 b: refs/heads/stable c: d1082aa h: refs/heads/master i: 225289: 01ca26a 225287: 48f0e2d v: v3
1 parent 6b74a3b commit dbf6fdd

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ refs/heads/tmp: e5d90d98402475b6e154ce216f9efcb80da1a747
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: 1fe32ca12c51afcd761d9962f51a74ff0d07a591
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828
32-
refs/heads/stable: 4decc408dc1dcac5b79edd41760cb85d3dde5a01
32+
refs/heads/stable: d1082aa3a1ec7d039b58eba994e32b79db778381
3333
refs/tags/1.0.0: 55bd4f8ff2b323f317ae89e254ce87162d52a375
3434
refs/tags/1.1.0: bc3c16f09287e5545c1d3f76b7abd54f2eca868b

branches/stable/src/etc/featureck.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,15 @@
7878
if not filename.endswith(".rs"):
7979
continue
8080

81+
if sys.version_info.major == 2:
82+
_open = lambda f: open(f, 'r')
83+
elif sys.version_info.major == 3:
84+
_open = lambda f: open(f, 'r', encoding="utf-8")
85+
else:
86+
raise RuntimeError("Unsupported python version: %s" % (repr(sys.version_info)))
87+
8188
path = os.path.join(dirpath, filename)
82-
with open(path, 'r') as f:
89+
with _open(path) as f:
8390
line_num = 0
8491
for line in f:
8592
line_num += 1

0 commit comments

Comments
 (0)