Fix argparse.ArgumentError needs two positional args

This commit is contained in:
James R. Barlow
2017-05-01 14:55:47 -07:00
parent 5b1a7880a9
commit cf643c9f43
+2 -1
View File
@@ -268,7 +268,7 @@ def check_options_languages(options, _log):
"data for the following requested languages: \n")
for lang in (set(options.language) - tesseract.languages()):
msg += lang + '\n'
raise argparse.ArgumentError(msg)
raise argparse.ArgumentError(None, msg)
def check_options_output(options, log):
@@ -324,6 +324,7 @@ def check_options_preprocessing(options, log):
def check_options_ocr_behavior(options, log):
if options.force_ocr and options.skip_text:
raise argparse.ArgumentError(
None,
"Error: --force-ocr and --skip-text are mutually incompatible.")
if set(options.language) & {'chi_sim', 'chi_tra'} and \