Skip to content

Commit 653fff8

Browse files
Apply suggestion from @gemini-code-assist[bot]
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
1 parent 6b9ec5e commit 653fff8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎torch_data/jsontojsongz.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def convert_json_to_gz(directory_path):
3737

3838
print(f"coverting: {json_file.name} -> {gz_file.name}")
3939

40-
except Exception as e:
40+
except (IOError, json.JSONDecodeError) as e:
4141
print(f"fail: {json_file.name} | 错误: {e}")
4242

4343
# 使用示例

0 commit comments

Comments
 (0)