tesseract: fix exception when logger is RootLogger

This commit is contained in:
James R. Barlow
2019-11-11 22:19:01 -08:00
parent 0c4b69ec5a
commit 9b2ab92913

View File

@@ -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()