summaryrefslogtreecommitdiffstats
path: root/meta/lib/oe/maketype.py
diff options
context:
space:
mode:
Diffstat (limited to 'meta/lib/oe/maketype.py')
-rw-r--r--meta/lib/oe/maketype.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/meta/lib/oe/maketype.py b/meta/lib/oe/maketype.py
index 139f333691..d36082c535 100644
--- a/meta/lib/oe/maketype.py
+++ b/meta/lib/oe/maketype.py
@@ -1,3 +1,6 @@
+#
+# SPDX-License-Identifier: GPL-2.0-only
+#
"""OpenEmbedded variable typing support
Types are defined in the metadata by name, using the 'type' flag on a
@@ -6,7 +9,8 @@ the arguments of the type's factory for details.
"""
import inspect
-import types
+import oe.types as types
+from collections.abc import Callable
available_types = {}
@@ -53,7 +57,9 @@ def get_callable_args(obj):
if type(obj) is type:
obj = obj.__init__
- args, varargs, keywords, defaults = inspect.getargspec(obj)
+ sig = inspect.signature(obj)
+ args = list(sig.parameters.keys())
+ defaults = list(s for s in sig.parameters.keys() if sig.parameters[s].default != inspect.Parameter.empty)
flaglist = []
if args:
if len(args) > 1 and args[0] == 'self':
@@ -93,7 +99,7 @@ for name in dir(types):
continue
obj = getattr(types, name)
- if not callable(obj):
+ if not isinstance(obj, Callable):
continue
register(name, obj)