Navigation Menu

Skip to content

Commit

Permalink
tesseract: fix exception when logger is RootLogger
Browse files Browse the repository at this point in the history
  • Loading branch information
James R. Barlow committed Nov 12, 2019
1 parent 0c4b69e commit 9b2ab92
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/ocrmypdf/exec/tesseract.py
Expand Up @@ -186,7 +186,9 @@ def get_orientation(input_file, engine_mode, timeout: float, log, tesseract_env=


def tesseract_log_output(mainlog, stdout, input_file):
log = TesseractLoggerAdapter(mainlog, extra=mainlog.extra)
log = TesseractLoggerAdapter(
mainlog, extra=mainlog.extra if hasattr(mainlog, 'extra') else None
)

try:
text = stdout.decode()
Expand Down

0 comments on commit 9b2ab92

Please sign in to comment.