Skip to content

Commit

Permalink
Better error message when flag parsing fail
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 696881696
  • Loading branch information
Conchylicultor authored and The ml_collections Authors committed Nov 15, 2024
1 parent d50762c commit da7c6fa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ml_collections/config_flags/config_path.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def split(config_path: str) -> Tuple[Any]:
try:
node = ast.parse(config_path, mode='eval')
except SyntaxError as e:
raise ValueError(e)
raise ValueError(f'Could not parse {config_path!r}: {e!r}') from None
if isinstance(node, ast.Expression):
result = _split_node(node.body)
if isinstance(result, tuple):
Expand Down

0 comments on commit da7c6fa

Please sign in to comment.