Skip to content

Commit e0734a6

Browse files
simplify
1 parent adcd533 commit e0734a6

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

Tools/i18n/msgfmt.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -161,13 +161,8 @@ def make(filename, outfile):
161161
if not msgid:
162162
# Filter out POT-Creation-Date
163163
# See issue #131852
164-
import re
165-
msgstr = re.sub(
166-
r"^POT-Creation-Date:.*(?:\n|$)",
167-
"",
168-
msgstr.decode(encoding),
169-
flags=re.MULTILINE,
170-
).encode(encoding)
164+
msgstr = ''.join(line for line in msgstr.decode(encoding).splitlines(True)
165+
if 'POT-Creation-Date' not in line).encode(encoding)
171166

172167
# See whether there is an encoding declaration
173168
p = HeaderParser()

0 commit comments

Comments
 (0)