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 1818# since the same version
1919# * Prints information about features
2020
21- import sys , os , re
21+ import sys
22+ import os
23+ import re
24+ import codecs
2225
2326if len (sys .argv ) < 2 :
2427 print ("usage: featureck.py <src-dir>" )
7881 if not filename .endswith (".rs" ):
7982 continue
8083
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-
8884 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 :
9086 line_num = 0
9187 for line in f :
9288 line_num += 1
You can’t perform that action at this time.
0 commit comments