From afc65c086ef2902c473808060c5bdcf1eadea3ed Mon Sep 17 00:00:00 2001 From: chengyongru <2755839590@qq.com> Date: Tue, 21 Jul 2026 00:43:51 +0800 Subject: [PATCH] refactor(session): simplify directory fsync handling --- nanobot/session/manager.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/nanobot/session/manager.py b/nanobot/session/manager.py index 3587ef2e..dfc49c3e 100644 --- a/nanobot/session/manager.py +++ b/nanobot/session/manager.py @@ -694,11 +694,10 @@ class SessionManager: with suppress(PermissionError): fd = os.open(str(path.parent), os.O_RDONLY) try: - try: - os.fsync(fd) - except OSError as exc: - if exc.errno != errno.EINVAL: - raise + os.fsync(fd) + except OSError as exc: + if exc.errno != errno.EINVAL: + raise finally: os.close(fd) except BaseException: