File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 1212import subprocess
1313import shutil
1414import bz2
15+ import io
1516
1617from distutils .spawn import find_executable as which
1718from distutils .version import StrictVersion
@@ -1497,10 +1498,11 @@ def write_config(data, name):
14971498 icu_ver_major = None
14981499 matchVerExp = r'^\s*#define\s+U_ICU_VERSION_SHORT\s+"([^"]*)".*'
14991500 match_version = re .compile (matchVerExp )
1500- for line in open (uvernum_h ).readlines ():
1501- m = match_version .match (line )
1502- if m :
1503- icu_ver_major = m .group (1 )
1501+ with io .open (uvernum_h , encoding = 'utf8' ) as in_file :
1502+ for line in in_file :
1503+ m = match_version .match (line )
1504+ if m :
1505+ icu_ver_major = str (m .group (1 ))
15041506 if not icu_ver_major :
15051507 error ('Could not read U_ICU_VERSION_SHORT version from %s' % uvernum_h )
15061508 elif int (icu_ver_major ) < icu_versions ['minimum_icu' ]:
You can’t perform that action at this time.
0 commit comments