diff options
Diffstat (limited to 'meta/lib/oe/maketype.py')
-rw-r--r-- | meta/lib/oe/maketype.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/meta/lib/oe/maketype.py b/meta/lib/oe/maketype.py index 139f333691..de344a802c 100644 --- a/meta/lib/oe/maketype.py +++ b/meta/lib/oe/maketype.py | |||
@@ -6,7 +6,8 @@ the arguments of the type's factory for details. | |||
6 | """ | 6 | """ |
7 | 7 | ||
8 | import inspect | 8 | import inspect |
9 | import types | 9 | import oe.types as types |
10 | import collections | ||
10 | 11 | ||
11 | available_types = {} | 12 | available_types = {} |
12 | 13 | ||
@@ -53,7 +54,9 @@ def get_callable_args(obj): | |||
53 | if type(obj) is type: | 54 | if type(obj) is type: |
54 | obj = obj.__init__ | 55 | obj = obj.__init__ |
55 | 56 | ||
56 | args, varargs, keywords, defaults = inspect.getargspec(obj) | 57 | sig = inspect.signature(obj) |
58 | args = list(sig.parameters.keys()) | ||
59 | defaults = list(s for s in sig.parameters.keys() if sig.parameters[s].default != inspect.Parameter.empty) | ||
57 | flaglist = [] | 60 | flaglist = [] |
58 | if args: | 61 | if args: |
59 | if len(args) > 1 and args[0] == 'self': | 62 | if len(args) > 1 and args[0] == 'self': |
@@ -93,7 +96,8 @@ for name in dir(types): | |||
93 | continue | 96 | continue |
94 | 97 | ||
95 | obj = getattr(types, name) | 98 | obj = getattr(types, name) |
96 | if not callable(obj): | 99 | if not isinstance(obj, collections.Callable): |
97 | continue | 100 | continue |
98 | 101 | ||
99 | register(name, obj) | 102 | register(name, obj) |
103 | |||