Skip to content

Commit b4ea80a

Browse files
committed
compile_messages now accepts several input files
This allows to use it to rebuild file12_fr.mo from both file1_fr_crlf.po and file2_fr_lf.po.
1 parent 677f720 commit b4ea80a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Lib/test/test_tools/test_msgfmt.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
msgfmt = script_dir / 'msgfmt.py'
2121

2222

23-
def compile_messages(po_file, mo_file):
24-
assert_python_ok(msgfmt, '-o', mo_file, po_file)
23+
def compile_messages(mo_file, *po_files):
24+
assert_python_ok(msgfmt, '-o', mo_file, *po_files)
2525

2626

2727
class CompilationTest(unittest.TestCase):
@@ -36,7 +36,7 @@ def test_compilation(self):
3636
expected = GNUTranslations(f)
3737

3838
tmp_mo_file = mo_file.name
39-
compile_messages(po_file, tmp_mo_file)
39+
compile_messages(tmp_mo_file, po_file)
4040
with open(tmp_mo_file, 'rb') as f:
4141
actual = GNUTranslations(f)
4242

@@ -174,9 +174,9 @@ def test_both_without_outputfile(self):
174174
def update_catalog_snapshots():
175175
for po_file in data_dir.glob('*.po'):
176176
mo_file = po_file.with_suffix('.mo')
177-
compile_messages(po_file, mo_file)
178-
# cannot use compile_message because of both input files
179-
assert_python_ok(msgfmt, '-o', data_dir /'file12_fr.mo',
177+
compile_messages(mo_file, po_file)
178+
# special processing for file12_fr.mo which results from 2 input files
179+
compile_messages(data_dir /'file12_fr.mo',
180180
data_dir / 'file1_fr_crlf.po',
181181
data_dir / 'file2_fr_lf.po')
182182

0 commit comments

Comments
 (0)