Skip to content

Commit

Permalink
In _import_dotted_name, raise AttributeError instead of ValueError wh…
Browse files Browse the repository at this point in the history
…en module doesn't have specified attribute.

PiperOrigin-RevId: 715850753
  • Loading branch information
Fiddle-Config Team authored and copybara-github committed Jan 15, 2025
1 parent 24b8b2e commit d45d7ca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fiddle/_src/absl_flags/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def _import_dotted_name(
)
module_name = '.'.join(name_pieces[: i + j])
failing_name = name_pieces[i + j]
raise ValueError(
raise AttributeError(
f'{mode.error_prefix(name)}: module {module_name!r} has no '
f'attribute {failing_name!r}; available names: {available_names}'
) from None
Expand Down

0 comments on commit d45d7ca

Please sign in to comment.