Remove lru_cache on get_version

Does not play well with forking.
This commit is contained in:
James R. Barlow
2020-05-12 03:51:48 -07:00
parent a2d3e0b53e
commit 6f5b75bcd0
5 changed files with 1 additions and 8 deletions
+1
View File
@@ -25,6 +25,7 @@ import sys
from collections.abc import Mapping
from contextlib import suppress
from distutils.version import LooseVersion
from functools import lru_cache
from subprocess import PIPE, STDOUT, CalledProcessError
from subprocess import run as subprocess_run
-2
View File
@@ -21,7 +21,6 @@ import logging
import os
import re
import warnings
from functools import lru_cache
from io import BytesIO
from os import fspath
from pathlib import Path
@@ -57,7 +56,6 @@ if os.name == 'nt':
GS = Path(GS).stem
@lru_cache(maxsize=1)
def version():
return get_version(GS)
-2
View File
@@ -17,14 +17,12 @@
"""Interface to jbig2 executable"""
from functools import lru_cache
from subprocess import PIPE
from ocrmypdf.exceptions import MissingDependencyError
from ocrmypdf.exec import get_version, run
@lru_cache(maxsize=1)
def version():
return get_version('jbig2', regex=r'jbig2enc (\d+(\.\d+)*).*')
-2
View File
@@ -17,7 +17,6 @@
"""Interface to pngquant executable"""
from functools import lru_cache
from subprocess import run
from tempfile import NamedTemporaryFile
@@ -27,7 +26,6 @@ from ocrmypdf.exceptions import MissingDependencyError
from ocrmypdf.exec import get_version
@lru_cache(maxsize=1)
def version():
return get_version('pngquant', regex=r'(\d+(\.\d+)*).*')
-2
View File
@@ -23,7 +23,6 @@
import logging
import os
import shlex
from functools import lru_cache
from pathlib import Path
from subprocess import PIPE, STDOUT, CalledProcessError
from tempfile import TemporaryDirectory
@@ -37,7 +36,6 @@ from ocrmypdf.exec import run as external_run
log = logging.getLogger(__name__)
@lru_cache(maxsize=1)
def version():
return get_version('unpaper')