Skip to content

Commit

Permalink
remove raise function
Browse files Browse the repository at this point in the history
  • Loading branch information
pereman2 committed Dec 20, 2020
1 parent b376ff2 commit 90589a4
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions omegaconf/listconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,16 +107,6 @@ def _validate_set(self, key: Any, value: Any) -> None:

value_type = OmegaConf.get_type(value)

def raise_validation_error(
value_type: Any, target_type: Any, value: Any
) -> None:
msg = (
f"Invalid type assigned : {type_str(value_type)} is not a "
f"subclass of {type_str(target_type)}. value: {value}"
)

raise ValidationError(msg)

if (
(
is_structured_config(value_type)
Expand All @@ -126,7 +116,12 @@ def raise_validation_error(
and value_type is not None
and not issubclass(value_type, target_type)
):
raise_validation_error(value_type, target_type, value)
msg = (
f"Invalid type assigned : {type_str(value_type)} is not a "
f"subclass of {type_str(target_type)}. value: {value}"
)

raise ValidationError(msg)

def __deepcopy__(self, memo: Dict[int, Any] = {}) -> "ListConfig":
res = ListConfig(content=[])
Expand Down

0 comments on commit 90589a4

Please # to comment.