Commit 23405f73 authored by Daniel Quinn's avatar Daniel Quinn 🍕 Committed by GitHub

Use `str()` instead of `.message` for exception

In a case where a `KeyError` is raised, the exception is caught, but then it tried to reference `ex.message`, which doesn't exist for KeyErrors in modern versions of Python.  Using `str(ex)` should deliver the same result.
parent ecb07b5c
......@@ -221,7 +221,7 @@ def detect_orientation(image, lang=None):
except Exception as ex:
raise TesseractError(-1, "No script found in image (%s - %s)"
% (ex.message, original_output))
% (str(ex), original_output))
def get_name():
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment