|
@@ -17,7 +17,11 @@ def split_file(file_dir, output_dir, endpoint=".py"):
|
|
|
for file_path in walk_files(file_dir, endpoint):
|
|
|
with open(file_path, 'r') as file:
|
|
|
content = file.read()
|
|
|
- root = ast.parse(content)
|
|
|
+ try:
|
|
|
+ root = ast.parse(content)
|
|
|
+ except Exception as e:
|
|
|
+ print("错误明细:", e.__class__.__name__, e, file_path)
|
|
|
+ continue
|
|
|
file_id = 1
|
|
|
for node in root.body:
|
|
|
if isinstance(node, ast.FunctionDef):
|