File tree Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Original file line number Diff line number Diff line change 18
18
# since the same version
19
19
# * Prints information about features
20
20
21
- import sys , os , re
21
+ import sys
22
+ import os
23
+ import re
24
+ import codecs
22
25
23
26
if len (sys .argv ) < 2 :
24
27
print ("usage: featureck.py <src-dir>" )
78
81
if not filename .endswith (".rs" ):
79
82
continue
80
83
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
84
path = os .path .join (dirpath , filename )
89
- with _open ( path ) as f :
85
+ with codecs . open ( filename = path , mode = 'r' , encoding = "utf-8" ) as f :
90
86
line_num = 0
91
87
for line in f :
92
88
line_num += 1
You can’t perform that action at this time.
0 commit comments