We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 272c7e8 commit d68cc17Copy full SHA for d68cc17
2 files changed
Lib/mimetypes.py
@@ -739,7 +739,6 @@ def _main(args=None):
739
else:
740
sys.exit(f"error: media type unknown for {gtype}")
741
return '\n'.join(results)
742
- return help_text
743
744
745
if __name__ == '__main__':
Lib/test/test_mimetypes.py
@@ -478,6 +478,14 @@ def test_multiple_inputs(self):
478
"type: image/png encoding: None"
479
)
480
481
+ def test_multiple_inputs_error(self):
482
+ with self.assertRaises(SystemExit) as err:
483
+ mimetypes._main(shlex.split("foo.pdf foo.bar_ext"))
484
+
485
+ self.assertNotEqual(err.exception.code, 0)
486
+ self.assertIn("error: media type unknown for foo.bar_ext", str(err.exception))
487
488
489
def test_invocation(self):
490
for command, expected in [
491
("-l -e image/jpg", ".jpg"),
0 commit comments