Skip to content
This repository was archived by the owner on Oct 10, 2025. It is now read-only.

Commit ca4dce3

Browse files
authored
fix: mkdir in accelerate (#33)
* fix: mkdir in accelerate * feat: new version
1 parent d9511f6 commit ca4dce3

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ build-backend = "hatchling.build"
99

1010
[project]
1111
name = "swankit"
12-
version = "0.2.3"
12+
version = "0.2.4"
1313
dynamic = ["readme", "dependencies"]
1414
description = "Base toolkit for SwanLab"
1515
license = "Apache-2.0"

swankit/core/settings.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,11 @@ def mkdir(self, path: str) -> None:
127127
"""创建目录
128128
为了保证安全性,不会递归创建
129129
"""
130-
if not os.path.exists(path) and self.should_save:
131-
os.mkdir(path)
130+
try:
131+
if not os.path.exists(path) and self.should_save:
132+
os.mkdir(path)
133+
except FileExistsError: # https://github.com/SwanHubX/SwanLab/issues/1090
134+
pass
132135

133136
# ---------------------------------- 静态属性 ----------------------------------
134137

0 commit comments

Comments
 (0)