From c713aef2549d8fa64b900a21dff11698b81ada0e Mon Sep 17 00:00:00 2001 From: Alexander Sokol Date: Tue, 24 Sep 2024 15:18:45 -0400 Subject: [PATCH] Replace calls to deprecated inspect._is_type by inspect.isclass. --- cl/runtime/primitive/primitive_util.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cl/runtime/primitive/primitive_util.py b/cl/runtime/primitive/primitive_util.py index 2c988197..88239a9d 100644 --- a/cl/runtime/primitive/primitive_util.py +++ b/cl/runtime/primitive/primitive_util.py @@ -44,7 +44,7 @@ class PrimitiveUtil: def is_primitive(cls, type_: Type | str) -> bool: """Check if the provided type is primitive.""" - type_name = type_.__name__ if inspect._is_type(type_) else type_ # noqa + type_name = type_.__name__ if inspect.isclass(type_) else type_ # noqa return type_name in cls.primitive_type_map @classmethod @@ -52,7 +52,7 @@ def is_primitive(cls, type_: Type | str) -> bool: def get_runtime_name(cls, type_: Type | str) -> str: """Return type's Runtime name.""" - type_name = type_.__name__ if inspect._is_type(type_) else type_ # noqa + type_name = type_.__name__ if inspect.isclass(type_) else type_ # noqa if not cls.is_primitive(type_name): raise RuntimeError(f"Primitive type {type_name} is not supported.") return cls.primitive_type_map.get(type_name)