Commit 051d2172 authored by Thomas Perret's avatar Thomas Perret

Correctly fix #104 for when libtesseract is not available

parent 272f4d03
......@@ -20,19 +20,10 @@ from . import tesseract_raw
from ..error import TesseractError
from ..util import digits_only
import locale
import logging
logger = logging.getLogger(__name__)
# Tesseract 4 workaround
try:
if tesseract_raw.get_version() == "4.0.0":
locale.setlocale(locale.LC_ALL, "C")
except AssertionError: # pragma: no cover
pass
__all__ = [
'can_detect_orientation',
'detect_orientation',
......
import ctypes
import locale
import logging
import os
import sys
......@@ -347,6 +348,11 @@ if g_libtesseract: # pragma: no cover
def init(lang=None):
assert(g_libtesseract)
# Tesseract 4 workaround
if get_version() == "4.0.0":
locale.setlocale(locale.LC_ALL, "C")
handle = g_libtesseract.TessBaseAPICreate()
try:
if lang:
......
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