浏览代码

Merge pull request #268 from tastelikefeet/fix/cli

fix cli imported by `fix token leakage`
Byaidu 1 年之前
父节点
当前提交
08199fd3d6
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      pdf2zh/high_level.py

+ 1 - 1
pdf2zh/high_level.py

@@ -292,7 +292,7 @@ def translate(
 
         doc_raw = open(file, "rb")
         s_raw = doc_raw.read()
-        s_mono, s_dual = translate_stream(s_raw, envs=kwarg["envs"], **locals())
+        s_mono, s_dual = translate_stream(s_raw, envs=kwarg.get('envs'), **locals())
         file_mono = Path(output) / f"{filename}-mono.pdf"
         file_dual = Path(output) / f"{filename}-dual.pdf"
         doc_mono = open(file_mono, "wb")