Skip to content

Commit 1714f3d

Browse files
committed
tools: allow icutrim.py to run on python2
Refs: nodejs/build#2998 Small icu seems broken from 14.x since it uses python2. Although main no longer supports python2 landing and backporting this change to the 14.x line would allow us to simplify future backports as currently the files are the same across lines. Signed-off-by: Michael Dawson <[email protected]>
1 parent 5d56097 commit 1714f3d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tools/icu/icutrim.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,10 @@ def removeList(count=0):
316316
erritems = fi.readlines()
317317
fi.close()
318318
#Item zone/zh_Hant_TW.res depends on missing item zone/zh_Hant.res
319-
pat = re.compile(bytes(r"^Item ([^ ]+) depends on missing item ([^ ]+).*", 'utf-8'))
319+
if (sys.version_info.major < 3):
320+
pat = re.compile(bytes(r"^Item ([^ ]+) depends on missing item ([^ ]+).*").encode('utf-8'))
321+
else:
322+
pat = re.compile(bytes(r"^Item ([^ ]+) depends on missing item ([^ ]+).*", 'utf-8'))
320323
for i in range(len(erritems)):
321324
line = erritems[i].strip()
322325
m = pat.match(line)

0 commit comments

Comments
 (0)