Skip to content

Transforms complex documents like PDFs and Office docs into LLM-ready markdown/JSON for your Agentic workflows.

fix: os moudle has no method named "exit"

许瑞43843b27aafe
diff --git a/magic_pdf/cli/magicpdf.py b/magic_pdf/cli/magicpdf.py
index 7eaf034b..97556bc8 100644
--- a/magic_pdf/cli/magicpdf.py
+++ b/magic_pdf/cli/magicpdf.py
@@ -72,7 +72,7 @@ def _do_parse(pdf_file_name, pdf_bytes, model_list, parse_method, image_writer,
pipe = OCRPipe(pdf_bytes, model_list, image_writer, is_debug=True)
else:
print("unknow parse method")
- os.exit(1)
+ sys.exit(1)
pipe.pipe_classify()
pipe.pipe_parse()
@@ -114,7 +114,7 @@ def cli():
def json_command(json, method):
if not json.startswith("s3://"):
print("usage: python magipdf.py --json s3://some_bucket/some_path")
- os.exit(1)
+ sys.exit(1)
def read_s3_path(s3path):
bucket, key = parse_s3path(s3path)