diff --git a/pyproject.toml b/pyproject.toml index 9b3b18f..dd04fe6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,7 @@ build-backend = "hatchling.build" [project] name = "swankit" -version = "0.2.3" +version = "0.2.4" dynamic = ["readme", "dependencies"] description = "Base toolkit for SwanLab" license = "Apache-2.0" diff --git a/swankit/core/settings.py b/swankit/core/settings.py index 125ab56..8d575e0 100644 --- a/swankit/core/settings.py +++ b/swankit/core/settings.py @@ -127,8 +127,11 @@ def mkdir(self, path: str) -> None: """创建目录 为了保证安全性,不会递归创建 """ - if not os.path.exists(path) and self.should_save: - os.mkdir(path) + try: + if not os.path.exists(path) and self.should_save: + os.mkdir(path) + except FileExistsError: # https://github.com/SwanHubX/SwanLab/issues/1090 + pass # ---------------------------------- 静态属性 ----------------------------------