Skip to content

Commit 5ba842b

Browse files
rvaggtargos
authored andcommittedOct 24, 2019
build: python3 support for configure
PR-URL: #30047 Reviewed-By: Christian Clauss <[email protected]> Reviewed-By: Sam Roberts <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: David Carlier <[email protected]>
1 parent f01c5c5 commit 5ba842b

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed
 

‎configure.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import subprocess
1313
import shutil
1414
import bz2
15+
import io
1516

1617
from distutils.spawn import find_executable as which
1718
from 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']:

0 commit comments

Comments
 (0)
Please sign in to comment.