Windows: Remove Program Files cache from ocrmypdf.exec

@lru_cache doesn't work here, so let's just remove it.
This commit is contained in:
James R. Barlow
2019-12-29 02:36:20 -08:00
parent 95ef5410c2
commit 708113a514
2 changed files with 4 additions and 6 deletions
+3 -4
View File
@@ -34,15 +34,14 @@ stages:
displayName: "Install system packages"
- pwsh: |
refreshenv
pip install --upgrade pip wheel
pip install -r requirements/main.txt -r requirements/test.txt .
tesseract --version
python -m pip install --upgrade pip wheel
python -m pip install -r requirements/main.txt -r requirements/test.txt .
displayName: "Install Python packages"
- pwsh: |
refreshenv
$env:pathext += ';.py'
# -n auto helps Windows
python3 -m pytest -n auto --junitxml=test.xml --cov=ocrmypdf --cov-report=xml
python -m pytest -n auto --junitxml=test.xml --cov=ocrmypdf --cov-report=xml
displayName: "Test"
- task: PublishTestResults@2
inputs:
+1 -2
View File
@@ -122,7 +122,6 @@ def get_version(program, *, version_arg='--version', regex=r'(\d+(\.\d+)*)', env
return version
@lru_cache(maxsize=1)
def shim_paths_with_program_files(env=None):
if not env:
env = os.environ
@@ -134,7 +133,7 @@ def shim_paths_with_program_files(env=None):
for dirname in os.listdir(program_files):
if dirname.lower() == 'tesseract-ocr':
paths.append(os.path.join(program_files, dirname))
if dirname.lower() == 'gs':
elif dirname.lower() == 'gs':
try:
latest_gs = max(
os.listdir(os.path.join(program_files, dirname)),