We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4decc40 commit d1082aaCopy full SHA for d1082aa
src/etc/featureck.py
@@ -78,8 +78,15 @@
78
if not filename.endswith(".rs"):
79
continue
80
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
+
88
path = os.path.join(dirpath, filename)
- with open(path, 'r') as f:
89
+ with _open(path) as f:
90
line_num = 0
91
for line in f:
92
line_num += 1
0 commit comments