Skip to content

Commit b55b456

Browse files
committed
address comments
1 parent 5d79b75 commit b55b456

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

pycyphal/dsdl/_lockfile.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# Copyright (c) 2025 OpenCyphal
2+
# This software is distributed under the terms of the MIT License.
3+
# Author: Huong Pham <[email protected]>
4+
5+
16
import logging
27
import pathlib
38
import time
@@ -25,7 +30,9 @@ def __enter__(self) -> bool:
2530
def __exit__(
2631
self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
2732
) -> None:
28-
return self.remove()
33+
if self._lockfile is not None:
34+
return self.remove()
35+
return None
2936

3037
def create(self) -> bool:
3138
"""

0 commit comments

Comments
 (0)