Skip to content

Commit

Permalink
Remove special of TypeError from ruffus
Browse files Browse the repository at this point in the history
split_pages would still run if repair_pdf failed, for some reason.
Since we are no longer splitting pages this is vestigial.
  • Loading branch information
James R. Barlow committed Jun 23, 2018
1 parent 76e7e8d commit 54e74f8
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions src/ocrmypdf/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -596,13 +596,6 @@ def do_ruffus_exception(ruffus_five_tuple, options, log):
elif exc_name == 'ruffus.ruffus_exceptions.MissingInputFileError':
log.error(cleanup_ruffus_error_message(exc_value))
exit_code = ExitCode.input_file
elif exc_name == 'builtins.TypeError':
# Even though repair_pdf will fail, ruffus will still try
# to call split_pages with no input files, likely due to a bug
if task_name == 'split_pages':
log.error("Input file '{0}' is not a valid PDF".format(
options.input_file))
exit_code = ExitCode.input_file
elif exc_name == 'builtins.KeyboardInterrupt':
log.error("Interrupted by user")
exit_code = ExitCode.ctrl_c
Expand Down

0 comments on commit 54e74f8

Please sign in to comment.