Skip to content

Commit

Permalink
Update function signature
Browse files Browse the repository at this point in the history
  • Loading branch information
odelalleau committed Mar 5, 2021
1 parent fc1d2c3 commit cd8655b
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions omegaconf/nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,9 +341,7 @@ def _validate_and_convert_impl(self, value: Any) -> Optional[Enum]:
return self.validate_and_convert_to_enum(enum_type=self.enum_type, value=value)

@staticmethod
def validate_and_convert_to_enum(
enum_type: Type[Enum], value: Any
) -> Optional[Enum]:
def validate_and_convert_to_enum(enum_type: Type[Enum], value: Any) -> Enum:
if not isinstance(value, (str, int)) and not isinstance(value, enum_type):
raise ValidationError(
f"Value $VALUE ($VALUE_TYPE) is not a valid input for {enum_type}"
Expand Down

0 comments on commit cd8655b

Please sign in to comment.