Skip to content

Commit

Permalink
Merge pull request #520 from plokmijnuhby/master
Browse files Browse the repository at this point in the history
Add support for python 3.12
  • Loading branch information
int3l authored Oct 15, 2023
2 parents 13f712d + 81ecdca commit aa974c3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
fail-fast: true
matrix:
include:
- {name: '3.12', python: '3.12', os: ubuntu-20.04, tox: py312}
- {name: '3.11', python: '3.11', os: ubuntu-20.04, tox: py311}
- {name: '3.10', python: '3.10', os: ubuntu-20.04, tox: py310}
- {name: '3.9', python: '3.9', os: ubuntu-20.04, tox: py39}
Expand Down
15 changes: 10 additions & 5 deletions pytesseract/pytesseract.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
from os.path import normcase
from os.path import normpath
from os.path import realpath
from pkgutil import find_loader
from tempfile import NamedTemporaryFile
from time import sleep
from typing import List
Expand All @@ -32,14 +31,20 @@

tesseract_cmd = 'tesseract'

numpy_installed = find_loader('numpy') is not None
if numpy_installed:
try:
from numpy import ndarray

pandas_installed = find_loader('pandas') is not None
if pandas_installed:
numpy_installed = True
except ModuleNotFoundError:
numpy_installed = False

try:
import pandas as pd

pandas_installed = True
except ModuleNotFoundError:
pandas_installed = False

LOGGER = logging.getLogger('pytesseract')

DEFAULT_ENCODING = 'utf-8'
Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ classifiers =
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Programming Language :: Python :: 3.12
Programming Language :: Python :: Implementation :: CPython
Programming Language :: Python :: Implementation :: PyPy
Expand Down

0 comments on commit aa974c3

Please sign in to comment.