Skip to content

Commit d0e48de

Browse files
author
Matthias Koeppe
committed
sage --fixdoctests: Exit after error message 'At least one filename is required'
1 parent 04a82b7 commit d0e48de

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/bin/sage-fixdoctests

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -538,8 +538,7 @@ def fix_with_distribution(file_set, distribution=None, verbose=False):
538538
if args.ignore_bad_distributions:
539539
print(f"sage-fixdoctests: {e}, ignoring")
540540
else:
541-
print(f"sage-fixdoctests: {e}")
542-
sys.exit(1)
541+
sys.exit(f"sage-fixdoctests: {e}")
543542

544543

545544
if __name__ == "__main__":
@@ -566,13 +565,12 @@ if __name__ == "__main__":
566565

567566
if len(args.distribution) > 1:
568567
if args.venv or args.environment:
569-
print('sage-fixdoctests: at most one --distribution argument can be combined with --venv and --environment')
570-
sys.exit(1)
568+
sys.exit("sage-fixdoctests: at most one --distribution argument can be combined with --venv and --environment")
571569
elif not args.distribution:
572570
args.distribution = ['']
573571

574572
if not args.filename and not args.update_known_test_failures:
575-
print("sage-fixdoctests: At least one filename is required when --update-known-test-failures is not used")
573+
sys.exit("sage-fixdoctests: At least one filename is required when --update-known-test-failures is not used")
576574

577575
if len(args.filename) == 2 and not args.overwrite and not args.no_overwrite:
578576
print("sage-fixdoctests: When passing two filenames, the second one is taken as an output filename; "

0 commit comments

Comments
 (0)