Skip to content

Commit

Permalink
Fix for #114 (#115)
Browse files Browse the repository at this point in the history
This is causing Nunavut 3.0 to become unresponsive if given a bad path.
  • Loading branch information
thirtytwobits authored Jan 10, 2025
1 parent 97fb20c commit 00445d4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pydsdl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import sys as _sys
from pathlib import Path as _Path

__version__ = "1.22.1"
__version__ = "1.22.2"
__version_info__ = tuple(map(int, __version__.split(".")[:3]))
__license__ = "MIT"
__author__ = "OpenCyphal"
Expand Down
6 changes: 3 additions & 3 deletions pydsdl/_dsdl_definition.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ class PathInferenceError(UndefinedDataTypeError):
Raised when the namespace, type, fixed port ID, or version cannot be inferred from a file path.
"""

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


Expand Down Expand Up @@ -83,7 +83,7 @@ def _infer_path_to_root_from_first_found(cls, dsdl_path: Path, valid_dsdl_roots:
"this root folder or provide a valid root path.",
dsdl_path,
valid_dsdl_roots,
)
) from None
return directly_inferred

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

0 comments on commit 00445d4

Please sign in to comment.