Skip to content

Commit

Permalink
batch: fix issues flagged by ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
jbarlow83 committed May 21, 2024
1 parent 579cef3 commit d5ff7f7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions misc/batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@

from __future__ import annotations

import filecmp
import logging
import sys
import os
import posixpath
import shutil
import filecmp
import sys
from pathlib import Path

import ocrmypdf
Expand Down Expand Up @@ -70,7 +70,7 @@ def filecompare(a, b):
logging.info(f"Archiving document to {archive_filename}")
try:
shutil.copy2(filename, posixpath.dirname(archive_filename))
except IOError as io_err:
except OSError:
os.makedirs(posixpath.dirname(archive_filename))
shutil.copy2(filename, posixpath.dirname(archive_filename))
try:
Expand All @@ -86,6 +86,6 @@ def filecompare(a, b):
logging.info(
"Skipped document because it does not need ocr as it is tagged"
)
except:
except Exception:
logging.error("Unhandled error occured")
logging.info("OCR complete")

0 comments on commit d5ff7f7

Please sign in to comment.