Skip to content

Commit 00445d4

Browse files
Fix for #114 (#115)
This is causing Nunavut 3.0 to become unresponsive if given a bad path.
1 parent 97fb20c commit 00445d4

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

pydsdl/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import sys as _sys
88
from pathlib import Path as _Path
99

10-
__version__ = "1.22.1"
10+
__version__ = "1.22.2"
1111
__version_info__ = tuple(map(int, __version__.split(".")[:3]))
1212
__license__ = "MIT"
1313
__author__ = "OpenCyphal"

pydsdl/_dsdl_definition.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ class PathInferenceError(UndefinedDataTypeError):
3131
Raised when the namespace, type, fixed port ID, or version cannot be inferred from a file path.
3232
"""
3333

34-
def __init__(self, text: str, dsdl_path: Path, valid_dsdl_roots: list[Path]):
35-
super().__init__(text=text, path=Path(dsdl_path))
34+
def __init__(self, text: str = "", dsdl_path: Path | None = None, valid_dsdl_roots: list[Path] | None = None):
35+
super().__init__(text=text, path=dsdl_path)
3636
self.valid_dsdl_roots = valid_dsdl_roots[:] if valid_dsdl_roots is not None else None
3737

3838

@@ -83,7 +83,7 @@ def _infer_path_to_root_from_first_found(cls, dsdl_path: Path, valid_dsdl_roots:
8383
"this root folder or provide a valid root path.",
8484
dsdl_path,
8585
valid_dsdl_roots,
86-
)
86+
) from None
8787
return directly_inferred
8888

8989
# INFERENCE 2: The next easiest inference is when the target path is relative to a known dsdl root. These

0 commit comments

Comments
 (0)