Skip to content

Commit 1253a2b

Browse files
committed
修正错误地把重名路径当成文件的bug
1 parent 71537b5 commit 1253a2b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

crazy_functions/latex_fns/latex_toolbox.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,10 +283,10 @@ def find_tex_file_ignore_case(fp):
283283
dir_name = os.path.dirname(fp)
284284
base_name = os.path.basename(fp)
285285
# 如果输入的文件路径是正确的
286-
if os.path.exists(pj(dir_name, base_name)): return pj(dir_name, base_name)
286+
if os.path.isfile(pj(dir_name, base_name)): return pj(dir_name, base_name)
287287
# 如果不正确,试着加上.tex后缀试试
288288
if not base_name.endswith('.tex'): base_name+='.tex'
289-
if os.path.exists(pj(dir_name, base_name)): return pj(dir_name, base_name)
289+
if os.path.isfile(pj(dir_name, base_name)): return pj(dir_name, base_name)
290290
# 如果还找不到,解除大小写限制,再试一次
291291
import glob
292292
for f in glob.glob(dir_name+'/*.tex'):

0 commit comments

Comments
 (0)