Skip to content

Commit 0415dd7

Browse files
rvaggtargos
authored andcommitted
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 4277066 commit 0415dd7

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

configure.py

+7-4
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
import shlex
1212
import subprocess
1313
import shutil
14+
import io
15+
1416
from distutils.spawn import find_executable as which
1517
from distutils.version import StrictVersion
1618

@@ -1499,10 +1501,11 @@ def write_config(data, name):
14991501
icu_ver_major = None
15001502
matchVerExp = r'^\s*#define\s+U_ICU_VERSION_SHORT\s+"([^"]*)".*'
15011503
match_version = re.compile(matchVerExp)
1502-
for line in open(uvernum_h).readlines():
1503-
m = match_version.match(line)
1504-
if m:
1505-
icu_ver_major = m.group(1)
1504+
with io.open(uvernum_h, encoding='utf8') as in_file:
1505+
for line in in_file:
1506+
m = match_version.match(line)
1507+
if m:
1508+
icu_ver_major = str(m.group(1))
15061509
if not icu_ver_major:
15071510
error('Could not read U_ICU_VERSION_SHORT version from %s' % uvernum_h)
15081511
elif int(icu_ver_major) < icu_versions['minimum_icu']:

0 commit comments

Comments
 (0)