Skip to content

Commit ce54d87

Browse files
jzhang533neteroster
andcommitted
Prepare 2.7.3 release (PaddlePaddle#11826)
* fix: Correct misuse of `try_import` from `paddle.utils` (PaddlePaddle#11820) This commit addresses the incorrect usage of the `try_import` function from `paddle.utils` in both `ppocr/utils/utility.py` and `ppstructure/pdf2word/pdf2word.py`. * bump version to 2.7.3 --------- Co-authored-by: NeterOster <neteroster@gmail.com>
1 parent f79033a commit ce54d87

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

ppocr/utils/utility.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,8 @@ def check_and_read(img_path):
108108
return imgvalue, True, False
109109
elif os.path.basename(img_path)[-3:].lower() == 'pdf':
110110
from paddle.utils import try_import
111-
try_import('fitz')
111+
112+
fitz = try_import("fitz")
112113
from PIL import Image
113114
imgs = []
114115
with fitz.open(img_path) as pdf:

ppstructure/pdf2word/pdf2word.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121
import cv2
2222
import platform
2323
import numpy as np
24-
import fitz
2524
from paddle.utils import try_import
26-
try_import('fitz')
25+
fitz = try_import("fitz")
26+
2727
from PIL import Image
2828
from pdf2docx.converter import Converter
2929
from qtpy.QtWidgets import QApplication, QWidget, QPushButton, QProgressBar, \

0 commit comments

Comments
 (0)