Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: python3 support for configure #30047

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import subprocess
import shutil
import bz2
import io

from distutils.spawn import find_executable as which
from distutils.version import StrictVersion
Expand Down Expand Up @@ -1497,10 +1498,11 @@ def write_config(data, name):
icu_ver_major = None
matchVerExp = r'^\s*#define\s+U_ICU_VERSION_SHORT\s+"([^"]*)".*'
match_version = re.compile(matchVerExp)
for line in open(uvernum_h).readlines():
m = match_version.match(line)
if m:
icu_ver_major = m.group(1)
with io.open(uvernum_h, encoding='utf8') as in_file:
for line in in_file:
m = match_version.match(line)
if m:
icu_ver_major = str(m.group(1))
if not icu_ver_major:
error('Could not read U_ICU_VERSION_SHORT version from %s' % uvernum_h)
elif int(icu_ver_major) < icu_versions['minimum_icu']:
Expand Down