Skip to content

Commit abffbd7

Browse files
committed
Address review: shorten error message and drop test
1 parent 44c7eab commit abffbd7

2 files changed

Lines changed: 3 additions & 12 deletions

File tree

‎Lib/test/test_tools/test_i18n.py‎

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@
77
from textwrap import dedent
88
from pathlib import Path
99

10-
from test.support.script_helper import (assert_python_failure,
11-
assert_python_ok,
12-
run_python_until_end)
10+
from test.support.script_helper import assert_python_failure, assert_python_ok
1311
from test.test_tools import imports_under_tool, skip_if_missing, toolsdir
1412
from test.support.os_helper import temp_cwd, temp_dir
1513

@@ -182,15 +180,9 @@ def test_no_input_file(self):
182180
res = assert_python_failure('-Xutf8', self.script, *args)
183181
self.assertEqual(res.rc, 1)
184182
self.assertEqual(res.out, b'')
185-
self.assertIn(b'pygettext: no input file given', res.err)
183+
self.assertIn(b'No input file given', res.err)
186184
self.assertFalse(os.path.exists('messages.pot'))
187185

188-
def test_missing_input_file_is_not_no_input(self):
189-
# A path that matches nothing is not the same as no path at all.
190-
with temp_cwd(None):
191-
res, _ = run_python_until_end(self.script, 'does_not_exist.py')
192-
self.assertNotIn(b'no input file given', res.err)
193-
194186
def test_funcdocstring(self):
195187
for doc in ('"""doc"""', "r'''doc'''", "R'doc'", 'u"doc"'):
196188
with self.subTest(doc):

‎Tools/i18n/pygettext.py‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -819,8 +819,7 @@ class Options:
819819

820820
# xgettext requires at least one input file
821821
if not args:
822-
print("pygettext: no input file given\n"
823-
"Try 'pygettext --help' for more information.",
822+
print("No input file given",
824823
file=sys.stderr)
825824
sys.exit(1)
826825

0 commit comments

Comments
 (0)