Skip to content

Commit

Permalink
fix error when config class is none
Browse files Browse the repository at this point in the history
  • Loading branch information
mdekstrand committed Jan 14, 2025
1 parent 38f6aaa commit dec445c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lenskit/lenskit/pipeline/components.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from abc import ABC, abstractmethod
from importlib import import_module
from inspect import isabstract
from types import FunctionType
from types import FunctionType, NoneType

from pydantic import JsonValue, TypeAdapter
from typing_extensions import (
Expand Down Expand Up @@ -169,7 +169,7 @@ def __init__(self, config: object | None = None, **kwargs: Any):
def _config_class(cls, return_any: bool = False) -> type | None:
hints = get_type_hints(cls)
ct = hints.get("config", None)
if ct is None:
if ct is None or ct == NoneType:
return None
elif ct == Any:
if return_any:
Expand Down

0 comments on commit dec445c

Please sign in to comment.